Skip to content

Commit

Permalink
Use sed for variable replacement as envsubst not found in cloud build
Browse files Browse the repository at this point in the history
  • Loading branch information
igooch committed Nov 19, 2024
1 parent 98647eb commit f56d250
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,17 +251,16 @@ steps:
waitFor:
- build-upgrade-test

- name: gcr.io/cloud-builders/gcloud
- name: gcr.io/google.com/cloudsdktool/cloud-sdk
id: submit-upgrade-test-cloud-build
dir: test/upgrade
entrypoint: bash
args:
- -c
- |
#!/usr/bin/env bash
set -e
set -o pipefail
export SHELL="/bin/bash"
export KUBECONFIG="/root/.kube/config"
mkdir -p /go/src/agones.dev/ /root/.kube/
ln -s /workspace /go/src/agones.dev/agones
Expand All @@ -275,8 +274,8 @@ steps:
# Update image tags to include the current build version.
DevVersion="1.45.0-dev-$(git rev-parse --short=7 HEAD)"
export DevVersion
envsubst < upgradeTest.yaml > "${tmpfile}"/upgradeTest.yaml
envsubst < versionMap.yaml > "${tmpfile}"/versionMap.yaml
sed "s/\${DevVersion}/${DevVersion}/" upgradeTest.yaml > "${tmpdir}"/upgradeTest.yaml
sed "s/\${DevVersion}/${DevVersion}/" versionMap.yaml > "${tmpdir}"/versionMap.yaml
# Kill all currently running child processes on exit or if a non-zero signal is seen
trap 'echo Cleaning up any remaining running pids: $(jobs -p) ; kill $(jobs -p) 2> /dev/null || :' EXIT SIGTERM
Expand Down Expand Up @@ -376,9 +375,7 @@ steps:
else
status=$?
outputLog="${waitPids[$pid]}"
# Truncate .log
cluster=${outputLog%.*}
echo "One of the upgrade tests pid $pid from cluster $cluster exited with a non-zero status ${status}."
echo "One of the upgrade tests pid $pid from cluster log $outputLog exited with a non-zero status ${status}."
exit $status
fi
done
Expand Down

0 comments on commit f56d250

Please sign in to comment.