Connecting a Cloud Build trigger to a third-party repository
Other chapters of this book use GitHub as a source code repository. Although GitHub is very popular, there are other top-tier repository providers out there, such as GitLab and BitBucket. This chapter’s example uses GitLab to illustrate a different integration than we’ve used in previous chapters.
To use GitLab as a source repository, there are three main steps:
- Create a host connection.
- Create a link to the repository.
- Create a Cloud Build trigger.
These three steps will be expanded upon in the following sections, starting with connecting to GitLab.
Creating a host connection to GitLab
Follow these steps to create a host connection to GitLab. This procedure assumes you have a GitLab account. These steps create two tokens. The first provides full API access, while the second provides API read-only access:
- In GitLab, create an api personal access token.
- Under User Settings...