Skip to content

Commit 98146b2

Browse files
committed
CI: place the packer key on disk via create-aws-stemcell/run
This replaces a separate create-packer-ci-key task to make `fly execute` easier.
1 parent fad65a8 commit 98146b2

File tree

4 files changed

+8
-26
lines changed

4 files changed

+8
-26
lines changed

ci/pipelines/stemcells-windows.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,11 +1371,6 @@ jobs:
13711371
params:
13721372
pre: build
13731373
tags: [*worker_tag]
1374-
- task: create-packer-ci-key
1375-
image: bosh-windows-stemcell-builder-ci-image
1376-
file: bosh-windows-stemcell-builder-ci/ci/tasks/create-packer-ci-key/task.yml
1377-
params:
1378-
PACKER_CI: ((bosh_windows_aws_packer_ci_private_key.private_key))
13791374
- task: create-aws-stemcell
13801375
attempts: 3
13811376
timeout: 2h
@@ -1387,6 +1382,7 @@ jobs:
13871382
PACKER_AWS_ACCESS_KEY: ((aws-stemcells_aws_access_key.username))
13881383
PACKER_AWS_SECRET_KEY: ((aws-stemcells_aws_access_key.password))
13891384
PACKER_REGION: ((AWS_PACKER_REGION))
1385+
PACKER_CI_PRIVATE_KEY: ((bosh_windows_aws_packer_ci_private_key.private_key))
13901386
OS_VERSION: windows((BASE_OS_VERSION))
13911387
OUTPUT_BUCKET_NAME: aws-regional-stemcells-((BASE_OS_VERSION))
13921388
VM_PREFIX: packer-prod-((BASE_OS_VERSION))
@@ -1549,11 +1545,6 @@ jobs:
15491545
- get: blobstore-gcs-cli
15501546
- get: windows-bsdtar
15511547
- get: windows-winsw
1552-
- task: create-packer-ci-key
1553-
image: bosh-windows-stemcell-builder-ci-image
1554-
file: bosh-windows-stemcell-builder-ci/ci/tasks/create-packer-ci-key/task.yml
1555-
params:
1556-
PACKER_CI: ((bosh_windows_aws_govcloud_packer_ci_private_key.private_key))
15571548
- task: create-aws-govcloud-stemcell
15581549
attempts: 3
15591550
timeout: 1h30m
@@ -1564,6 +1555,7 @@ jobs:
15641555
AWS_REGION: us-gov-west-1
15651556
PACKER_AWS_SECRET_KEY: ((packer_user_gov_aws_access_key.password))
15661557
PACKER_REGION: ((AWS_GOVCLOUD_PACKER_REGION))
1558+
PACKER_CI_PRIVATE_KEY: ((bosh_windows_aws_packer_ci_private_key.private_key))
15671559
OS_VERSION: windows((BASE_OS_VERSION))
15681560
OUTPUT_BUCKET_NAME: aws-regional-stemcells-((BASE_OS_VERSION))
15691561
VM_PREFIX: packer-prod-((BASE_OS_VERSION))

ci/tasks/create-aws-stemcell/run

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
set -eu -o pipefail
33
set -x
44

5+
CONCOURSE_ROOT="$(pwd)"
6+
57
if [ -n "${AWS_ROLE_ARN}" ]; then
68
aws configure --profile creds_account set aws_access_key_id "${PACKER_AWS_ACCESS_KEY}"
79
set +x
@@ -18,13 +20,15 @@ else
1820
export AWS_SECRET_KEY="${PACKER_AWS_SECRET_KEY}"
1921
set -x
2022
fi
23+
export PACKER_CI_PRIVATE_KEY_LOCATION="${CONCOURSE_ROOT}/packer-ci-private-key/packer_key"
24+
mkdir -p "$(dirname "${PACKER_CI_PRIVATE_KEY_LOCATION}")"
25+
echo "${PACKER_CI_PRIVATE_KEY}" > "${PACKER_CI_PRIVATE_KEY_LOCATION}"
26+
chmod 600 "${PACKER_CI_PRIVATE_KEY_LOCATION}"
2127

2228
pushd lgpo-binary
2329
unzip LGPO.zip
2430
popd
2531

26-
CONCOURSE_ROOT="$(pwd)"
27-
2832
"${CONCOURSE_ROOT}/bosh-windows-stemcell-builder-ci/ci/tasks/build-agent-zip/run.sh"
2933
"${CONCOURSE_ROOT}/bosh-windows-stemcell-builder-ci/ci/tasks/build-psmodules-zip/run.sh"
3034

ci/tasks/create-aws-stemcell/task.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ inputs:
77
- name: base-amis
88
- name: version
99
- name: lgpo-binary
10-
- name: packer-ci-private-key
1110
- name: bosh-agent-release
1211
- name: blobstore-dav-cli
1312
- name: blobstore-s3-cli

ci/tasks/create-packer-ci-key/task.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)