-
Notifications
You must be signed in to change notification settings - Fork 762
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
misc updates to readme, added PR template, added small ci/cd doc (#1245)
* misc updates to readme, added PR template, cleaned up tutorial, added cicd doc * small tweaks * addressed comments * comment was in the wrong spot
- Loading branch information
1 parent
7b1da15
commit 4f4639f
Showing
9 changed files
with
135 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Contributing a Pull Request | ||
|
||
If you haven't already, read the full [contribution guide](../CONTRIBUTING.md). The guide may have changed since the last time you read it, so please double-check. Once you are done and ready to submit your PR, run through the relevant checklist below. | ||
|
||
## Contributing to documentation | ||
|
||
* [ ] The contribution does not exist in any of the docs in either the root of the [docs](../docs) directory or the [specs](../docs/spec) | ||
|
||
## Contributing an example | ||
|
||
* [ ] I have checked that there is not an equivalent example already submitted | ||
* [ ] I have resolved all warnings and errors shown by the Bicep VS Code extension | ||
* [ ] I have checked that all tests are passing by running `dotnet test` | ||
* [ ] I have consistent casing for all of my identifiers and am using camelCasing unless I have a justification to use another casing style | ||
|
||
## Contributing a feature | ||
|
||
* [ ] I have opened a new issue for the proposal, or commented on an existing one, and ensured that the bicep maintainers are good with the design of the feature being implemented | ||
* [ ] I have included "Fixes #{issue_number}" in the PR description, so GitHub can link to the issue and close it when the PR is merged | ||
* [ ] I have appropriate test coverage of my new feature |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Adding bicep to a CI/CD pipeline | ||
|
||
As your bicep practice matures, you will want to check-in your bicep code into source control and kick off a pipeline or workflow, which would do the following: | ||
|
||
1. Build your bicep file into an ARM Template | ||
1. Deploy the generated ARM template | ||
|
||
In order to do this, we need to make sure the bicep CLI is installed on the build agent. For now, bicep is not preinstalled on any build agents or tasks provided by Microsoft, but installing it manually as part of the pipeline is straightforward. | ||
|
||
The following example is designed to be run in GitHub actions workflow and uses Azure CLI, but could be easily adapted to run in a Azure DevOps Pipeline. It assumes the following prerequisite: | ||
|
||
* The bicep file you want to transpile and deploy is called `main.bicep` and exists in the root of the repo | ||
* You are deploying the transpiled ARM Template to a resource group. Deploying to another scope like a subscription requires a different CLI command. | ||
|
||
```yaml | ||
|
||
name: bicep build and deploy | ||
|
||
on: push | ||
|
||
jobs: | ||
bicep-build-and-deploy: | ||
name: bicep build and deploy | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Checks out a copy of your repository on the ubuntu-latest machine | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
# Install the latest release of the bicep CLI | ||
- name: Install bicep CLI | ||
run: | | ||
curl -Lo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64 | ||
chmod +x ./bicep | ||
sudo mv ./bicep /usr/local/bin/bicep | ||
bicep --help | ||
# Transpile bicep file into ARM template | ||
- name: Build ARM Template from bicep file | ||
run: | | ||
bicep build ./main.bicep | ||
# Stop here if you only want to do "CI" which just generates the | ||
# build artifact (ARM Template JSON) | ||
|
||
# Login to Azure | ||
- name: Azure Login | ||
uses: azure/login@v1 | ||
with: | ||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
|
||
# Emit template what-if to show what template will do | ||
- name: Run what-if | ||
uses: azure/CLI@v1 | ||
with: | ||
inlineScript: | | ||
az account show | ||
az deployment group what-if -f ./main.json -p ./parameters.json -g my-rg | ||
# You may want a human approval in between the what-if step | ||
# and the deploy step to evaluate output before deployment | ||
|
||
# Deploy template | ||
- name: Deploy template | ||
uses: azure/CLI@v1 | ||
with: | ||
inlineScript: | | ||
az account show | ||
az deployment group create -f ./main.json -g my-rg | ||
``` | ||
Instead of installing the bicep CLI manually, you may instead want to use the [community-maintained github action](https://github.com/marketplace/actions/bicep-build) from [@justinyoo](https://github.com/justinyoo) that can run `bicep build` on your behalf. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters