Skip to content

Commit

Permalink
Add replication regions to Azure job
Browse files Browse the repository at this point in the history
Signed-off-by: peterdeme <[email protected]>
  • Loading branch information
peterdeme committed Sep 20, 2024
1 parent 673cc48 commit c8df0a7
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build_gcp_azure_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
PKR_VAR_gallery_resource_group: rg-worker_images-public-westeurope
PKR_VAR_gallery_name: spacelift_worker_images_public
PKR_VAR_gallery_image_name: spacelift_worker_image
PKR_VAR_gallery_replication_regions: '["westeurope"]'
PKR_VAR_gallery_replication_regions: '["westeurope", "northeurope", "northcentralus", "eastus", "eastus2", "westus2", "westus3"]'
PKR_VAR_gallery_image_version: 1.0.${{ github.run_number }}

steps:
Expand Down Expand Up @@ -169,10 +169,10 @@ jobs:
console.log("## Azure");
console.log("");
console.log(`- Publisher | \`spaceliftinc1625499025476\`.`);
console.log(`- Offer | \`spacelift_worker\`.`);
console.log(`- SKU | \`ubuntu_20_04\`.`);
console.log(`- Version | \`1.0.${process.env.RUN_NUMBER}\`.`);
console.log(`- Community Gallery Name | \`spacelift-40913cda-9bf9-4bcb-bf90-78fd83f30079\``);
console.log(`- Image name | \`spacelift_worker_image\``);
console.log(`- Version | \`1.0.${process.env.RUN_NUMBER}\``);
console.log(`- Resource ID | \`/CommunityGalleries/spacelift-40913cda-9bf9-4bcb-bf90-78fd83f30079/Images/spacelift_worker_image/Versions/1.0.${process.env.RUN_NUMBER}\``);
console.log("");
console.log("## Google Cloud Platform");
console.log("");
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
PKR_VAR_gallery_resource_group: rg-worker_images-public-westeurope
PKR_VAR_gallery_name: spacelift_worker_images_public
PKR_VAR_gallery_image_name: spacelift_worker_image
PKR_VAR_gallery_replication_regions: '["westeurope"]'
PKR_VAR_gallery_replication_regions: '["westeurope", "northeurope", "northcentralus", "eastus", "eastus2", "westus2", "westus3"]'
PKR_VAR_gallery_image_version: 1.0.${{ github.run_number }}

steps:
Expand Down
17 changes: 16 additions & 1 deletion azure.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,18 @@ source "azure-arm" "spacelift" {
gallery_name = var.gallery_name
image_name = var.gallery_image_name
image_version = var.gallery_image_version
replication_regions = var.gallery_replication_regions

target_region {
name = var.location
}

dynamic target_region {
for_each = var.gallery_replication_regions

content {
name = target_region.value
}
}
}

os_type = "Linux"
Expand Down Expand Up @@ -151,6 +162,10 @@ build {
"shared/scripts/apt-install-jq.sh",
"azure/scripts/azure-cli.sh",
]

env = {
DEBIAN_FRONTEND = "noninteractive"
}
}

# Deprovision VM
Expand Down
4 changes: 4 additions & 0 deletions gcp.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ build {
"shared/scripts/gvisor.sh",
"shared/scripts/apt-install-jq.sh",
]

env = {
DEBIAN_FRONTEND = "noninteractive"
}
}

post-processor "manifest" {
Expand Down

0 comments on commit c8df0a7

Please sign in to comment.