-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
anupam
committed
Feb 14, 2023
1 parent
996c7c7
commit 7363c84
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Cloud Build | ||
Google Cloud Build is a serverless CI/CD offering on the Google Cloud. | ||
|
||
## Cloud Build Concepts | ||
1. Cloud Build allows running builds in automated fashion using the concept of triggers. Using triggers, we can instruct Cloud Build to run the build based on certain conditions like a new commit pushed to any branch in the repository. | ||
|
||
2. We describe the steps in a build config (configuration file) which could be in YAML or JSON format to perform various tasks like building artifacts when triggered. The config file lives in the the source code repository. | ||
|
||
3. Cloud Build uses Docker to execute builds. Cloud Build executes your build as a series of build steps mentioned in build config file, where each build step is run in a Docker container. | ||
|
||
4. Cloud builders are container images with common languages and tools installed in them. You can configure Cloud Build to run a specific command within the context of these builders. Cloud Build enables you to use any publicly available image to execute your tasks. | ||
|
||
## Create cloud build trigger | ||
If you are using the user-specified service account to create build trigger, You must create or start builds in the command line using 'gcloud builds submit' or 'gcloud beta builds triggers create'. | ||
|
||
``` | ||
gcloud builds triggers create github --name="terraform-gcp-lab-trigger" --service-account="projects/clear-tape-374908/serviceAccounts/[email protected]" --repo-owner="anupam-sy" --repo-name="terraform-gcp-lab" --description="terraform-gcp-lab" --branch-pattern="^master$" --build-config=".cloudbuild/cloudbuild.yaml" | ||
``` | ||
|
||
**Note:** To use the Triggers page in the Google Cloud console, the user-specified service account and the build trigger must be in the same project. | ||
|
||
## Reference | ||
- https://cloud.google.com/build/docs/securing-builds/configure-user-specified-service-accounts |