Skip to content

Commit

Permalink
feat(azure): publish to community gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdeme committed Sep 13, 2024
1 parent 1316726 commit 9c97c46
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_gcp_azure_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
PKR_VAR_image_resource_group: rg-worker_images-public-westeurope
PKR_VAR_packer_work_group: rg-worker_images_packer-public-westeurope
PKR_VAR_gallery_resource_group: rg-worker_images-public-westeurope
PKR_VAR_gallery_name: worker_images_public
PKR_VAR_gallery_name: spacelift_worker_images_public
PKR_VAR_gallery_image_name: ubuntu_20_04
PKR_VAR_gallery_replication_regions: '["westeurope"]'
PKR_VAR_gallery_image_version: 1.0.${{ github.run_number }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
PKR_VAR_image_resource_group: rg-worker_images-public-westeurope
PKR_VAR_packer_work_group: rg-worker_images_packer-public-westeurope
PKR_VAR_gallery_resource_group: rg-worker_images-public-westeurope
PKR_VAR_gallery_name: worker_images_public
PKR_VAR_gallery_name: spacelift_worker_images_public
PKR_VAR_gallery_image_name: ubuntu_20_04
PKR_VAR_gallery_replication_regions: '["westeurope"]'
PKR_VAR_gallery_image_version: 1.0.${{ github.run_number }}
Expand Down
18 changes: 7 additions & 11 deletions azure.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ variable "gallery_resource_group" {

variable "gallery_name" {
type = string
default = null
}

variable "gallery_image_name" {
Expand Down Expand Up @@ -111,16 +110,13 @@ source "azure-arm" "spacelift" {
managed_image_name = var.image_name
managed_image_resource_group_name = var.image_resource_group

dynamic "shared_image_gallery_destination" {
for_each = var.gallery_name != null ? [0] : []
content {
subscription = var.subscription_id
resource_group = var.gallery_resource_group
gallery_name = var.gallery_name
image_name = var.gallery_image_name
image_version = var.gallery_image_version
replication_regions = var.gallery_replication_regions
}
shared_image_gallery_destination {
subscription = var.subscription_id
resource_group = var.gallery_resource_group
gallery_name = var.gallery_name
image_name = var.gallery_image_name
image_version = var.gallery_image_version
replication_regions = var.gallery_replication_regions
}

os_type = "Linux"
Expand Down

0 comments on commit 9c97c46

Please sign in to comment.