Skip to content

Instantly share code, notes, and snippets.

@lazypower
Created November 21, 2016 18:50
Show Gist options
  • Save lazypower/99d963116471f1e45a1d2e76e8e75d29 to your computer and use it in GitHub Desktop.
Save lazypower/99d963116471f1e45a1d2e76e8e75d29 to your computer and use it in GitHub Desktop.
#!/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