0
votes

I'm trying to automate the creation of Google Cloud projects and setup Google Cloud Build to automatically build a github repository.

But before creating the triggers with gcloud CLI, i have to "link" the remote github repository and I haven't find clues on how to do it.

If I don't do that, i have the following error:

ERROR: (gcloud.beta.builds.triggers.create.github) FAILED_PRECONDITION: Repository mapping does not exist. Please visit https://console.cloud.google.com/cloud-build/triggers/connect?project=ID to connect a repository to your project

My github repositories use the Google Cloud Build github app to allow the cloud build integration.

1

1 Answers

0
votes

In Google documentation regarding creating triggers there is a part with gcloud beta:

To create a trigger if your source code is in GitHub:

    gcloud beta builds triggers create github \
    --repo-name=[REPO_NAME] \
    --repo-owner=[REPO_OWNER] \
    --branch-pattern=".*" \
    --build-config=[BUILD_CONFIG_FILE] \ ```

Please check gcloud reference for the command.