Google Cloud Build
Google Cloud Build watches a connected repository and runs a cloudbuild.yaml build on changes. One build step calls the Testsigma shell script, so every push triggers the test plan automatically.
Prerequisites
- A GitHub repository, a Google Cloud project with billing enabled, and admin in both.
Open Cloud Build
Section titled “Open Cloud Build”-
Pick a project: In the Google Cloud Console, click Select a Project. Select an existing project from the list, or click New Project in the Select a project dialog.
-
Find Cloud Build: Open the navigation menu and click View all products.
-
Open it: In the left panel, under Categories, click CI/CD, then click Cloud Build.
Connect the repository
Section titled “Connect the repository”-
Start the connection: In the Cloud Build navigation pane, click Repositories, then click Connect repository.
-
Pick the provider: On the Connect repository overlay, select your source code management provider (GitHub in this example) and click Continue. Cloud Build redirects you to GitHub to authorize.
-
Select the repository: Return to Cloud Build, which authenticates automatically. In the Select repository step, expand the dropdown and select the repository.
Create a trigger
Section titled “Create a trigger”-
Add the trigger: Go to Triggers in the Cloud Build menu and click + Create trigger.
-
Name it: Enter a name in the Name field.
-
Pick the source: Under Source, select the repository and branch from the Repository and Branch dropdowns.
-
Pick the configuration type: Under Configuration, select the Cloud Build configuration file (yaml or json) radio button.
-
Pick the file location: Under Location, select the Repository radio button to fetch the pipeline file from your GitHub repository. Alternatively, select Inline and click Open editor to add the YAML manually.
-
Add the build config: For inline configuration, paste the following in the Edit Inline Configuration overlay and click Done:
cloudbuild.yaml steps:- name: 'ubuntu:20.04'args:- '-c'- |apt-get update && apt-get install -y curl bash coreutilschmod +x tstrigger.sh./tstrigger.shentrypoint: bashoptions:logging: CLOUD_LOGGING_ONLY -
Set the service account: Under Advanced, select the required account in the Service account dropdown and click Create.
Run and check the build
Section titled “Run and check the build”Click Run on the newly created trigger. Build results, including the Testsigma run the script starts, appear under History in the Cloud Build menu.
Was this page helpful?
Thanks for the feedback.