Created
November 21, 2016 18:50
-
-
Save lazypower/99d963116471f1e45a1d2e76e8e75d29 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
set -e | |
CONFIG_CONTAINER=$(docker ps -aq -f name=gcloud-config) | |
echo $CONFIG_CONTAINER | |
# This script assumes there is a gce.json file in $PWD. | |
# Suggested to put this service account credential (.p12) file in a Jenkins Secret | |
if [ -z $CONFIG_CONTAINER ]; then | |
docker run -v $PWD/gce.json:/root/gce.json --name gcloud-config google/cloud-sdk \ | |
gcloud auth activate-service-account --key-file /root/gce.json --project ubuntu-benchmarking | |
fi | |
docker run --rm -ti --volumes-from gcloud-config google/cloud-sdk gsutil ls |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment