Skip to content

Commit

Permalink
refactor: prefer the service account token over the older deployer to…
Browse files Browse the repository at this point in the history
…ken (#225)
  • Loading branch information
shreddedbacon authored Sep 14, 2023
1 parent 9e7870a commit a7a6ad3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions legacy/build-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ PRIVATE_DOCKER_HUB_REGISTRY=0
PRIVATE_EXTERNAL_REGISTRY=0

set +x # reduce noise in build logs
if [[ -f "/var/run/secrets/lagoon/deployer/token" ]]; then
DEPLOYER_TOKEN=$(cat /var/run/secrets/lagoon/deployer/token)
else
if [[ -f "/var/run/secrets/kubernetes.io/serviceaccount/token" ]]; then
DEPLOYER_TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
fi
else
if [[ -f "/var/run/secrets/lagoon/deployer/token" ]]; then
DEPLOYER_TOKEN=$(cat /var/run/secrets/lagoon/deployer/token)
fi
if [ -z ${DEPLOYER_TOKEN} ]; then
echo "No deployer token found"; exit 1;
fi
Expand Down

0 comments on commit a7a6ad3

Please sign in to comment.