Generate packer manifests and store them as artifacts

For each AMI build, generate a manifest file with details of the built
artifacts, like AMI IDs. This information can be then used for any
release documentation we might do in the future.

Related https://gitlab.com/gitlab-org/distribution/team-tasks/-/issues/460

Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
This commit is contained in:
Balasankar 'Balu' C 2022-11-30 01:03:10 +00:00 committed by Robert Marshall
parent 8cc8bc20b1
commit 2a6b25fd76
9 changed files with 44 additions and 0 deletions

2
.gitignore vendored
View File

@ -40,3 +40,5 @@ spec/examples.txt
coverage/
junit_rspec.xml
support/packer/manifests

View File

@ -239,6 +239,9 @@
tags:
- docker-builder
cache: !reference [.tag-cache]
artifacts:
paths:
- support/packer/manifests
needs:
- Ubuntu-20.04
retry: 1

View File

@ -125,4 +125,10 @@ build {
script = "update-script-ce.sh"
}
post-processor "manifest" {
output = "manifests/ce-arm64-manifest.json"
custom_data = {
name: "${var.ami_prefix}GitLab CE ${var.version} (ARM64)"
}
}
}

View File

@ -125,4 +125,10 @@ build {
script = "update-script-ce.sh"
}
post-processor "manifest" {
output = "manifests/ce-manifest.json"
custom_data = {
name: "${var.ami_prefix}GitLab CE ${var.version}"
}
}
}

View File

@ -122,4 +122,10 @@ build {
script = "update-script-ee.sh"
}
post-processor "manifest" {
output = "manifests/ee-arm64-manifest.json"
custom_data = {
name: "${var.ami_prefix}GitLab EE ${var.version} (ARM64)"
}
}
}

View File

@ -121,4 +121,10 @@ build {
script = "update-script-ee-premium.sh"
}
post-processor "manifest" {
output = "manifests/ee-premium-manifest.json"
custom_data = {
name: "${var.ami_prefix}GitLab EE ${var.version} Premium"
}
}
}

View File

@ -121,4 +121,10 @@ build {
script = "update-script-ee-ultimate.sh"
}
post-processor "manifest" {
output = "manifests/ee-ultimate-manifest.json"
custom_data = {
name: "${var.ami_prefix}GitLab EE ${var.version} Ultimate"
}
}
}

View File

@ -122,4 +122,10 @@ build {
script = "update-script-ee.sh"
}
post-processor "manifest" {
output = "manifests/ee-manifest.json"
custom_data = {
name: "${var.ami_prefix}GitLab EE ${var.version}"
}
}
}

View File

@ -13,4 +13,7 @@ PACKER_PATH=$(pwd)/support/packer
cd $PACKER_PATH
# To store the post processor manifest file
mkdir -p manifests
packer build -var "aws_access_key=$AWS_AMI_ACCESS_KEY_ID" -var "aws_secret_key=$AWS_AMI_SECRET_ACCESS_KEY" -var "version=$VERSION" -var "download_url=$DOWNLOAD_URL" -var "license_file=$EE_LICENSE_FILE" $PACKER_PATH/$TYPE.pkr.hcl