Skip to content

Instantly share code, notes, and snippets.

@gillesdemey
Created May 29, 2017 10:02
Show Gist options
  • Save gillesdemey/4db2b04d5ab89e038c71b4bbb79e9f5f to your computer and use it in GitHub Desktop.
Save gillesdemey/4db2b04d5ab89e038c71b4bbb79e9f5f to your computer and use it in GitHub Desktop.
Authenticate with gloud and kubectl in Drone
pipeline:
...
deploy:
image: google/cloud-sdk
commands:
- printenv KUBE_SERVICE_ACCOUNT > credentials.json
- gcloud auth activate-service-account --key-file=credentials.json
- "gcloud container clusters get-credentials $CLUSTER_NAME \
--zone $PROJECT_ZONE \
--project $PROJECT_NAME"
- kubectl set image deployment <deployment> <container>=<image> --record
when:
status: success
@tonglil
Copy link

tonglil commented Dec 14, 2022

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