Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curl path download file extension added #1896

Merged
merged 1 commit into from Mar 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions docs/cicd-with-bicep.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ name: bicep build and deploy

on: push

env:
# Common variables
AZURE_RESOURCE_GROUP: 'myResourceGroupName'

jobs:
bicep-build-and-deploy:
name: bicep build and deploy
Expand All @@ -28,12 +32,12 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

# Install the latest release of the bicep CLI
- name: Install bicep CLI
# Install the latest release of the bicep CLI binaries
- name: Install bicep CLI Binaries
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
curl -Lo bicep.bin https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anthony-c-martin - any idea why @pinakighatak needed to add the .bin extension here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any extension will work. I just put bin. Curl does not seem to work without this extension.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure - I've not had any problems running this command on OSX, Linux or WSL.

@pinakighatak Does the following work for you by any chance (specifying the current directory with ./)?

curl -Lo ./bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64

It doesn't matter much, as this is just a temporary name before the exe is moved to /usr/local/bin/bicep

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying this directly on my GitHub workflow pipeline. Adding ./bicep does not work. See below:
image

But adding an extension (any) works smoothly.
image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given the extension doesn't matter, I'm inclined to merge this.

chmod +x ./bicep.bin
sudo mv ./bicep.bin /usr/local/bin/bicep
bicep --help

# Transpile bicep file into ARM template
Expand All @@ -56,7 +60,7 @@ jobs:
with:
inlineScript: |
az account show
az deployment group what-if -f ./main.json -p ./parameters.json -g my-rg
az deployment group what-if -f ./main.json -p ./parameters.json -g ${{ env.AZURE_RESOURCE_GROUP }}

# You may want a human approval in between the what-if step
# and the deploy step to evaluate output before deployment
Expand All @@ -67,7 +71,7 @@ jobs:
with:
inlineScript: |
az account show
az deployment group create -f ./main.json -g my-rg
az deployment group create -f ./main.json -g ${{ env.AZURE_RESOURCE_GROUP }}
```

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.