Skip to content

Instantly share code, notes, and snippets.

@satyadeepk
Last active February 18, 2022 12:21
Show Gist options
  • Save satyadeepk/b0146a0ccefc87fc41a86ea7250ec23e to your computer and use it in GitHub Desktop.
Save satyadeepk/b0146a0ccefc87fc41a86ea7250ec23e to your computer and use it in GitHub Desktop.
Jenkins Google Cloud SDK install with auth script
#Ref: https://github.com/circleci/android-cloud-test-lab/blob/master/circle.yml
export DIRECTORY="/var/jenkins_home/GoogleCloudSDK/google-cloud-sdk/bin"
if [ ! -d "$DIRECTORY" ]; then
# Control will enter here if $DIRECTORY doesn't exist.
cd /var/jenkins_home
wget https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.zip -O google-cloud-sdk.zip
unzip -o google-cloud-sdk.zip -d ./GoogleCloudSDK/
./GoogleCloudSDK/google-cloud-sdk/install.sh
fi
export PATH=/var/jenkins_home/GoogleCloudSDK/google-cloud-sdk/bin:$PATH
gcloud --quiet components update
gcloud --quiet components install beta
gcloud auth activate-service-account --key-file $GCLOUD_SERVICE_AUTH
gcloud config set project addodoc-1
gcloud beta test android run --app $WORKSPACE/app/build/outputs/apk/app-debug.apk --test $WORKSPACE/app/build/outputs/apk/app-debug-androidTest-unaligned.apk --results-bucket cloud-test-jenkins
@yog560
Copy link

yog560 commented Apr 24, 2019

@vijaykumar.. how did you pass service_account_key (json file)... ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment