Skip to content
You're viewing the v2 docs. Looking for v1?Go to v1 docs
Docs
Testsigma
Popular questions
↑↓ to navigate↵ to selectesc to close
Book a demo

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.
  1. 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.

  2. Find Cloud Build: Open the navigation menu and click View all products.

  3. Open it: In the left panel, under Categories, click CI/CD, then click Cloud Build.

  1. Start the connection: In the Cloud Build navigation pane, click Repositories, then click Connect repository.

  2. 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.

  3. Select the repository: Return to Cloud Build, which authenticates automatically. In the Select repository step, expand the dropdown and select the repository.

  1. Add the trigger: Go to Triggers in the Cloud Build menu and click + Create trigger.

  2. Name it: Enter a name in the Name field.

  3. Pick the source: Under Source, select the repository and branch from the Repository and Branch dropdowns.

  4. Pick the configuration type: Under Configuration, select the Cloud Build configuration file (yaml or json) radio button.

  5. 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.

  6. 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 coreutils
    chmod +x tstrigger.sh
    ./tstrigger.sh
    entrypoint: bash
    options:
    logging: CLOUD_LOGGING_ONLY
  7. Set the service account: Under Advanced, select the required account in the Service account dropdown and click Create.

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?