Skip to content

Commit

Permalink
test az action
Browse files Browse the repository at this point in the history
  • Loading branch information
Silvija Tovernic committed Sep 19, 2024
1 parent 7e3db5e commit 3e3386e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/packer-build-if-vm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,25 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

# - name: Template packer vars file
# uses: cuchi/[email protected]
# with:
# template: images/packer/image-factory-vm/values.auto.pkrvars.hcl.j2
# output_file: images/packer/image-factory-vm/values.auto.pkrvars.hcl

- name: Azure Login
uses: azure/login@v2
with:
creds: ${{ env.AZURE_CREDENTIALS }}

- name: Create Image Definition
- name: Create Azure Image Definition
uses: azure/cli@v2
with:
azcliversion: 2.64.0
inlineScript: |
set +e
image_definition_exists=$(az sig image-definition show \
az sig image-definition show \
--resource-group "$AZURE_RESOURCE_GROUP" \
--gallery-name "$AZURE_ACG" \
--gallery-image-definition "$IMAGE_NAME" \
--query "name" -o tsv)
--query "name" -o tsv
az_exit_code=$?
set -e
if [ -z "$image_definition_exists" ]; then
if [ $az_exit_code -eq 3 ]; then
echo "Image definition does not exist. Creating it..."
az sig image-definition create \
--resource-group "$AZURE_RESOURCE_GROUP" \
Expand All @@ -70,3 +65,8 @@ jobs:
echo "Image definition '$IMAGE_NAME' already exists."
fi
# - name: Template packer vars file
# uses: cuchi/[email protected]
# with:
# template: images/packer/image-factory-vm/values.auto.pkrvars.hcl.j2
# output_file: images/packer/image-factory-vm/values.auto.pkrvars.hcl

0 comments on commit 3e3386e

Please sign in to comment.