Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(azure): publish to community gallery #62

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build_gcp_azure_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ 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_image_name: ubuntu_20_04
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_image_version: 1.0.${{ github.run_number }}

Expand All @@ -53,7 +53,7 @@ jobs:

- name: Authenticate with GCP
if: matrix.cloud == 'gcp'
uses: google-github-actions/auth@v1
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS_JSON }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ 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_image_name: ubuntu_20_04
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_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