Giter Site home page Giter Site logo

trigger-gcp-cloudbuild's Introduction

Trigger GCP Cloudbuild

References

Test setup

  • Create GCP service account with "Cloud Container Builder Editor" role (check the box "Furnish a new private key" and select key type "JSON".
  • Note the [/PATH/TO/SERVICE/ACCOUNT/KEYFILE].json

Local test steps

  • Run the built test image:

    $ docker run --rm -v [/PATH/TO/SERVICE/ACCOUNT/KEYFILE].json:/key.json --env PROJECT_ID=[GCP-PROJECT-ID] --env GOOGLE_APPLICATION_CREDENTIALS=/key.json docker.io/r6by/trigger-gcp-cloudbuild

Local test steps during development

  • Build vendor directory and packages:

    $ dep ensure -v
  • In your local session, set the $GOOGLE_APPLICATION_CREDENTIALS variable that golang.org/x/oauth2/google FindDefaultCredentials() looks for, and the $PROJECT_ID variable with the name of your GCP project ID:

    $ export GOOGLE_APPLICATION_CREDENTIALS=[/PATH/TO/SERVICE/ACCOUNT/KEYFILE].json'
    $ export PROJECT_ID=[GCP-PROJECT-ID]
  • Run the main package:

    $ go run main.go

GKE test steps

  • Create generic secret for $GOOGLE_APPLICATION_CREDENTIALS ENV var:

    $ kubectl create secret generic google-application-credentials --from-file=key.json=[/PATH/TO/SERVICE/ACCOUNT/KEYFILE].json
  • Deploy the main test app:

    $ helm install trigger-gcp-cloudbuild/ --set projectID=[GCP-PROJECT-ID] --name trigger-gcp-cloudbuild
  • Monitor the output with kubectl logs (or - shameless plug - try kpoof for fast, prompted k8s logs)

  • Cleanup:

    $ helm delete --purge trigger-gcp-cloudbuild
    $ kubectl delete secret google-application-credentials

trigger-gcp-cloudbuild's People

Contributors

scottrigby avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.