This repository has been archived by the owner on Apr 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from circleci/install-gcloud
Adding gcloud
- Loading branch information
Showing
2 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |