Skip to content

Commit

Permalink
Merge pull request #10 from Ontotext-AD/TES-417_
Browse files Browse the repository at this point in the history
Added support for specifying subscription in create_image_definition.sh
  • Loading branch information
viktor-ribchev authored Jan 23, 2024
2 parents 800221d + 96e0e37 commit 7915251
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to the Packer template for creating GraphDB Azure VM images

- Removed features preventing build with Standard_B1ls VM
- Fixed create_image_definition.sh
- Added support for specifying subscription in create_image_definition.sh

## 1.1.0

Expand Down
4 changes: 3 additions & 1 deletion create_image_definition.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ variables_file="variables.pkrvars.hcl"
if [ -f "$variables_file" ]; then
# Use grep to extract the variable values

subscription_id=$(grep 'subscription_id' "$variables_file" | cut -d '"' -f 2)
image_definition_name=$(grep 'image_definition_name' "$variables_file" | cut -d '"' -f 2)
gdb_version=$(grep 'gdb_version' "$variables_file" | cut -d '"' -f 2)
gallery_resource_group=$(grep 'gallery_resource_group' "$variables_file" | cut -d '"' -f 2)
Expand All @@ -26,6 +27,7 @@ if [ -f "$variables_file" ]; then

# TODO extend command with --features 'IsAcceleratedNetworkSupported=true DiskControllerTypes=SCSI,NVMe' when we have quota for Standard_B2pts_v2
az_command="az sig image-definition create \
--subscription $subscription_id \
-g $gallery_resource_group \
--gallery-name $gallery_name \
--gallery-image-definition "$image_definition_name" \
Expand All @@ -41,7 +43,7 @@ if [ -f "$variables_file" ]; then

echo "Extracted variables and constructed Azure CLI command:"
eval "$az_command"
az sig image-definition wait -i "$image_definition_name" -r "$gallery_name" -g "$gallery_resource_group" --created
az sig image-definition wait -i "$image_definition_name" -r "$gallery_name" -g "$gallery_resource_group" --created --subscription $subscription_id
packer build -var-file="variables.pkrvars.hcl" .
else
echo "The variables file $variables_file does not exist."
Expand Down
2 changes: 1 addition & 1 deletion variables.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ variable vm_size {
type = string
default = "Standard_B1ls"
# TODO replace with B2pts_v2 when quota is available in order to build with IsAcceleratedNetworkSupported=true DiskControllerTypes=SCSI,NVMe features
# default = "Standard_B2pts_v2"
# default = "Standard_B2ats_v2"
}

variable image_replica_count {
Expand Down

0 comments on commit 7915251

Please sign in to comment.