Skip to content
This repository was archived by the owner on Dec 26, 2022. It is now read-only.

Commit 702dfe4

Browse files
Update Packer artifact nesting
This is to maintain compatibility with the `grapl-rc` plugin which changed it's nesting logic with grapl-security/grapl-rc-buildkite-plugin#19 Signed-off-by: Christopher Maier <[email protected]>
1 parent 261cd22 commit 702dfe4

4 files changed

+14
-10
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
"multiple-runs-single-region.us-east-1": "ami-aaaaaaaaaaaaaaaaa"
2+
"multiple-runs-single-region": {
3+
"us-east-1": "ami-aaaaaaaaaaaaaaaaa"
4+
}
35
}
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
2-
"single-run-multiple-regions.us-east-1": "ami-aaaaaaaaaaaaaaaaa",
3-
"single-run-multiple-regions.us-east-2": "ami-bbbbbbbbbbbbbbbbb",
4-
"single-run-multiple-regions.us-west-1": "ami-ccccccccccccccccc",
5-
"single-run-multiple-regions.us-west-2": "ami-ddddddddddddddddd"
2+
"single-run-multiple-regions": {
3+
"us-east-1": "ami-aaaaaaaaaaaaaaaaa",
4+
"us-east-2": "ami-bbbbbbbbbbbbbbbbb",
5+
"us-west-1": "ami-ccccccccccccccccc",
6+
"us-west-2": "ami-ddddddddddddddddd"
7+
}
68
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
"single-run-single-region.us-east-1": "ami-aaaaaaaaaaaaaaaaa"
2+
"single-run-single-region": {
3+
"us-east-1": "ami-aaaaaaaaaaaaaaaaa"
4+
}
35
}

lib/extract_ami_id_dict.jq

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@
1212
| map(split(":"))
1313

1414
# sample output:
15-
# { "imgname.us-east-1": "ami-111", ...}
15+
# { "imgname": {"us-east-1": "ami-111"}}
1616
| reduce .[] as $region_and_ami_id(
1717
{}; # becomes the self - or `.` in below context
18-
# We use a period delimiter in the key so that, much later down the pipeline,
19-
# we can shove it into `pulumi config set --path artifacts.imagename.region`
20-
.[$IMAGE_NAME + "." + $region_and_ami_id[0]] = $region_and_ami_id[1] # {[k] = v}
18+
setpath([$IMAGE_NAME, $region_and_ami_id[0]]; $region_and_ami_id[1])
2119
)

0 commit comments

Comments
 (0)