Create a Cloud Build Trigger

In this section, we will create a Cloud Build trigger which will trigger automatically the cloud build file on any push to the github repo and deploy to test.

  1. Go to https://github.com/jfrogtraining/gcp-gke-workshop and fork this repo.

  2. Navigate to Cloud Buiild and select Triggers from the left pane.

  3. Click on + CREATE TRIGGER and give it a name workshop.

  4. Select CONNECT NEW REPOSITORY in source, which will take you to authenticate your github repo from where you want to trigger cloud build.

Tiggers Connect Repo

  1. Select Github as source, authenticate and then in Select Repository select your github account and forked workshop repo, click Connect.

Tiggers Select Source

  1. Next from Configuration select Cloud Build configuration file and in Location select the repository added above, add workshop-app/cloudbuild.yaml as Cloud Build configuration file location.

Tiggers Config file

  1. Now add substituition variable used in cloud build file: _JFROG_SERVER_NAME , _JFROG_USER

Tiggers sub var

  1. Click on Create.

Tiggers final