Skip to content

Instantly share code, notes, and snippets.

@nieldw
Created January 3, 2019 16:58
Show Gist options
  • Save nieldw/276ac089b14839e4be5d0ea47015f2a6 to your computer and use it in GitHub Desktop.
Save nieldw/276ac089b14839e4be5d0ea47015f2a6 to your computer and use it in GitHub Desktop.
Update Google Cloud Build trigger
#!/usr/bin/env bash
PROJECT_ID=$(gcloud config get-value core/project --quiet)
JSON=$1
TRIGGER_ID=$(jq -r '.id' ${JSON})
curl -s -XPATCH -T ${JSON} -H"Authorization: Bearer $(gcloud config config-helper --format='value(credential.access_token)')" https://cloudbuild.googleapis.com/v1/projects/${PROJECT_ID}/triggers/${TRIGGER_ID} | jq '.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment