diff --git a/Dockerfile b/Dockerfile index b272e88..233c1d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -59,6 +59,10 @@ RUN circleci-install qt ADD circleci-provision-scripts/awscli.sh /opt/circleci-provision-scripts/awscli.sh RUN circleci-install awscli +# gcloud +ADD circleci-provision-scripts/gcloud.sh /opt/circleci-provision-scripts/gcloud.sh +RUN circleci-install gcloud + # Languages ARG use_precompile=true ENV USE_PRECOMPILE $use_precompile diff --git a/circleci-provision-scripts/gcloud.sh b/circleci-provision-scripts/gcloud.sh new file mode 100755 index 0000000..9dfc98e --- /dev/null +++ b/circleci-provision-scripts/gcloud.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +function install_gcloud() { + # Using sudo inside `as_user bash` is confusing but this is needed becase + # gcloud installation script needs to instal .config/gcloud dir under user's $HOME directory. + (cat <<'EOF' +sudo bash -c 'curl "https://sdk.cloud.google.com" | CLOUDSDK_CORE_DISABLE_PROMPTS=1 CLOUDSDK_INSTALL_DIR=/opt bash' +EOF + ) | as_user bash + chown -R $CIRCLECI_USER:$CIRCLECI_USER "/opt/google-cloud-sdk" + chown -R $CIRCLECI_USER:$CIRCLECI_USER ${CIRCLECI_HOME}/.config/gcloud +}