File tree Expand file tree Collapse file tree 5 files changed +24
-13
lines changed Expand file tree Collapse file tree 5 files changed +24
-13
lines changed Original file line number Diff line number Diff line change 1
- # Copyright 2018 Google LLC. All rights reserved.
1
+ # Copyright 2024 Google LLC. All rights reserved.
2
2
#
3
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
4
# you may not use this file except in compliance with the License.
11
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
# See the License for the specific language governing permissions and
13
13
14
- FROM marketplace.gcr.io/google/debian11
14
+ FROM marketplace.gcr.io/google/debian12
15
15
16
- ENV PACKER_VERSION 1.8.3
17
- ENV PACKER_SHA256 0587f7815ed79589cd9c2b754c82115731c8d0b8fd3b746fe40055d969facba5
18
- ENV PACKER_BINARY /bin/packer
16
+ ENV PACKER_VERSION=1.11.2
17
+ ENV PACKER_SHA256=ced13efc257d0255932d14b8ae8f38863265133739a007c430cae106afcfc45a
18
+ ENV PACKER_BINARY= /bin/packer
19
19
20
- ENV CHEF_DIR /chef
21
- ENV PACKER_DIR /packer/templates
22
- ENV TESTS_DIR /tests
23
- ENV KEY_FILE_PATH /service-account.json
20
+ ENV CHEF_DIR= /chef
21
+ ENV PACKER_DIR= /packer/templates
22
+ ENV TESTS_DIR= /tests
23
+ ENV KEY_FILE_PATH= /service-account.json
24
24
25
25
# Installs packages
26
26
RUN set -eux \
Original file line number Diff line number Diff line change 1
- timeout: 600s
1
+ timeout: 800s
2
2
options:
3
3
workerPool: projects/${PROJECT_ID}/locations/us-central1/workerPools/gcb-workers-pool-e2
4
4
steps:
Original file line number Diff line number Diff line change @@ -95,6 +95,10 @@ python3 "${SCRIPT_DIR}/packergen.py" "${INPUT_TEMPLATE}" > /tmp/template.json
95
95
96
96
echo "Packer: $("${PACKER_BINARY}" -v)"
97
97
98
+ # Install googlecompute and chef plugins
99
+ "${PACKER_BINARY}" plugins install github.com/hashicorp/googlecompute
100
+ "${PACKER_BINARY}" plugins install github.com/hashicorp/chef
101
+
98
102
# Build the packer command
99
103
PACKER_COMMAND=("${PACKER_BINARY}" build -color=false)
100
104
PACKER_COMMAND+=(-var "chefdir=${CHEF_DIR}")
Original file line number Diff line number Diff line change 20
20
21
21
# Install chef-solo via deb package.
22
22
INSTALL_CHEF_SOLO = r"""
23
- declare -r VERSION=18.2.7
24
- declare -r SHA256=a4461840de71f08f11f3c65a6d2f40f41d394e98f84979f7a8388ed0b578c666
23
+ declare -r VERSION=18.5.0
24
+ declare -r SHA256=1918e72eebeea0dd2f7680b08f1362d699b37570431ebca3c1b4fbe40cfc2abb
25
25
26
26
curl "https://packages.chef.io/files/stable/chef/${VERSION}/debian/11/chef_${VERSION}-1_amd64.deb" -o chef-solo.deb \
27
27
&& echo "${SHA256} chef-solo.deb" | sha256sum -c \
Original file line number Diff line number Diff line change @@ -94,18 +94,25 @@ while (( ${index} <= ${max_connection_attempts} )); do
94
94
done
95
95
96
96
# Create $IMAGEBUILDER_TEST_DIR directory and upload tests there
97
+ echo "Copying tests to the tester instance..."
98
+ ssh -i "${PRIVATE_SSH_KEY}" \
99
+ -o UserKnownHostsFile="${TEMPDIR}/known_hosts" \
100
+ -o StrictHostKeyChecking=no \
101
+ "${USER}@${IP}" \
102
+ "/bin/bash -e -c 'mkdir -p "${IMAGEBUILDER_TEST_DIR}"'"
97
103
scp -r \
98
104
-i "${PRIVATE_SSH_KEY}" \
99
105
-o UserKnownHostsFile="${TEMPDIR}/known_hosts" \
100
106
-o StrictHostKeyChecking=no \
101
107
"${TESTS_DIR}" "${USER}@${IP}:${IMAGEBUILDER_TEST_DIR}/"
102
108
103
109
# Run tests
110
+ echo "Running tests in tester instance..."
104
111
ssh -i "${PRIVATE_SSH_KEY}" \
105
112
-o UserKnownHostsFile="${TEMPDIR}/known_hosts" \
106
113
-o StrictHostKeyChecking=no \
107
114
"${USER}@${IP}" \
108
- "/bin/bash -eu -c 'chmod +x ${IMAGEBUILDER_TEST_DIR}/run-tests-on-instance.sh && PACKER_SSH_USERNAME=${PACKER_SSH_USERNAME} SOLUTION_NAME=${SOLUTION_NAME} ${IMAGEBUILDER_TEST_DIR}/run-tests-on-instance.sh'" \
115
+ "/bin/bash -eu -c 'chmod +x ${IMAGEBUILDER_TEST_DIR}/tests/ run-tests-on-instance.sh && PACKER_SSH_USERNAME=${PACKER_SSH_USERNAME} SOLUTION_NAME=${SOLUTION_NAME} ${IMAGEBUILDER_TEST_DIR}/tests /run-tests-on-instance.sh'" \
109
116
&& lcstatus=$? || lcstatus=$?
110
117
111
118
echo "--> Deleting the temporary instance (${INSTANCE}) ..."
You can’t perform that action at this time.
0 commit comments