-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Silvija Tovernic
committed
Sep 19, 2024
1 parent
7e3db5e
commit 3e3386e
Showing
1 changed file
with
10 additions
and
10 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 |
---|---|---|
|
@@ -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" \ | ||
|
@@ -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 |