Last active
February 26, 2018 18:19
-
-
Save dezmaeth/69af9ef1fc28989eda9dc6e0f91b2dfc to your computer and use it in GitHub Desktop.
Install gcloud and kubectl on semaphore-ci
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
#!/bin/bash | |
## Usage: | |
## IMPORTANT: GCLOUD_VERSION env variable set before running ex: export GCLOUD_VERSION=190.0.1 | |
## curl https://gist.githubusercontent.com/dezmaeth/69af9ef1fc28989eda9dc6e0f91b2dfc/raw/semaphore_ci_gcloud_prepare.sh | sh | |
export PATH=$SEMAPHORE_CACHE_DIR/google-cloud-sdk/bin:$PATH | |
if [ ! -f "$SEMAPHORE_CACHE_DIR/google-cloud-sdk/bin/gcloud" ] | |
then | |
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-$GCLOUD_VERSION-linux-x86_64.tar.gz | |
tar -x -C $SEMAPHORE_CACHE_DIR -f google-cloud-sdk-$GCLOUD_VERSION-linux-x86_64.tar.gz | |
gcloud --quiet components update --version $GCLOUD_VERSION | |
gcloud --quiet components update --version $GCLOUD_VERSION beta | |
fi | |
if [ ! -f "$SEMAPHORE_CACHE_DIR/google-cloud-sdk/bin/kubectl" ] | |
then | |
gcloud --quiet components update --version $GCLOUD_VERSION kubectl | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment