Skip to content

Commit

Permalink
Add manifest.json generation to Packer
Browse files Browse the repository at this point in the history
Signed-off-by: peterdeme <[email protected]>
  • Loading branch information
peterdeme committed Oct 24, 2023
1 parent 04f3a61 commit a7e6d13
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/build_aws_scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,8 @@ jobs:
PKR_VAR_ami_name_prefix: spacelift-${{ needs.timestamp.outputs.timestamp }}
PKR_VAR_source_ami_architecture: ${{ matrix.arch }}
PKR_VAR_instance_type: ${{ matrix.arch == 'x86_64' && 't3.micro' || 't4g.micro' }}

- name: Upload manifest
uses: actions/upload-artifact@v3
with:
path: manifest_aws.json
7 changes: 6 additions & 1 deletion .github/workflows/build_gcp_azure_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,9 @@ jobs:
run: |
gcloud compute images add-iam-policy-binding ${PKR_VAR_image_base_name}-us-${PKR_VAR_suffix} --member='allAuthenticatedUsers' --role='roles/compute.imageUser'
gcloud compute images add-iam-policy-binding ${PKR_VAR_image_base_name}-eu-${PKR_VAR_suffix} --member='allAuthenticatedUsers' --role='roles/compute.imageUser'
gcloud compute images add-iam-policy-binding ${PKR_VAR_image_base_name}-asia-${PKR_VAR_suffix} --member='allAuthenticatedUsers' --role='roles/compute.imageUser'
gcloud compute images add-iam-policy-binding ${PKR_VAR_image_base_name}-asia-${PKR_VAR_suffix} --member='allAuthenticatedUsers' --role='roles/compute.imageUser'ű
- name: Upload manifest
uses: actions/upload-artifact@v3
with:
path: manifest_${{matrix.cloud}}.json
4 changes: 4 additions & 0 deletions aws.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,8 @@ build {
tag_value = "Spacelift AMI"
keep_releases = 180
}

post-processor "manifest" {
output = "manifest_aws.json"
}
}
4 changes: 4 additions & 0 deletions azure.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,8 @@ build {
]
inline_shebang = "/bin/sh -x"
}

post-processor "manifest" {
output = "manifest_azure.json"
}
}
4 changes: 4 additions & 0 deletions gcp.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,8 @@ build {
"shared/scripts/apt-install-jq.sh",
]
}

post-processor "manifest" {
output = "manifest_gcp.json"
}
}

0 comments on commit a7e6d13

Please sign in to comment.