SlideShare a Scribd company logo
Overview and Examples
Evgenii Studitskikh
Full Stack developer at Rounds
What is Cloud Build?
Cloud Build is Google Cloud Platform's fully managed CI/CD platform that allows
you to build, test, and deploy applications across multiple environments and
programming languages.
Key Features
● Execute builds in a fully managed environment
● Support of Docker containers
● YAML-based build configuration files (cloudbuild.yaml)
● Direct integration with Google Cloud Storage
● Cloud Logging and Monitoring integration
What’s Under the Hood?
● Docker Containers: Each build step runs inside an isolated container.
● Kubernetes Engine: The build infrastructure scales dynamically based on
its workload.
● Cloud Storage: It stores artifacts and logs for easy retrieval and auditing.
● IAM & Security: Access control with Identity and Access Management
(IAM).
● Cloud Pub/Sub: Used for event-driven build triggers and notifications.
● Cloud Logging & Monitoring: Provides real-time log streaming and
observability for debugging and performance analysis.
How to run the build?
● Automatically via GitHub, Bitbucket, etc.
● Manually through CLI or code.
Build triggers
● Name, Region, Description, Tags
● Event (repository event that invokes trigger)
○ Push to a repo branch, new tag, pull request
○ Manual invocation
○ Pub/Sub message
○ Webhook event
● Configuration
○ File (yaml or json)
○ Dockerfile, Buildpacks (only for repositories)
● Substitution variables
● Service account
How to configure the cloudbuild.yaml
Cloudbuild.yaml
steps:
- name: gcr.io/cloud-builders/gsutil
args:
- cp
- $_KEYSTORE_URL
- /workspace/keystore.jks
id: download-keystore
- name: ubuntu
args:
- '-c'
- |
apt-get update && apt-get install -y unzip
unzip file.zip
# Get the most recently created folder from workspace
folder_name=$(ls -dt */ 2>/dev/null | head -n 1 | xargs basename)
mv $folder_name android_app
id: unzip-source-code
entrypoint: sh
timeout: 3600s
logsBucket: 'gs://build-logs/$BUILD_ID'
artifacts:
objects:
location: 'gs://build-artifacts/$BUILD_ID'
paths:
- /workspace/android_app/app/build/outputs/apk/release/**
- /workspace/android_app/app/build/outputs/bundle/release/**
Explanation:
# (name) Defines the container image to be used for that step (More builders: gcr.io/cloud-builders)
# Copies a file from a given URL
# ($)Environment variable storing the URL of the keystore file
# Destination path inside the build workspace (root dir)
# Step identifier
# Executes a multi-line command in the shell
# Uses the shell as the entrypoint
# Sets a timeout limit for the build process
# Stores logs in a Cloud Storage bucket
# Specifies where build artifacts are stored
# Uploads release APK files
# Uploads release bundle files
Build logs
● Cloud Build provides real-time logging of each step execution.
● Logs are streamed to Cloud Logging and can be viewed in the GCP Console.
● Errors and warnings are highlighted to help with debugging.
● Logs are stored in a specified Cloud Storage bucket (logsBucket parameter).
Integration with Node.js
Installing the client library:
npm install @google-cloud/cloudbuild
Using the client library:
const {CloudBuildClient} = require('@google-cloud/cloudbuild');
const [resp] = await cb.runBuildTrigger({
projectId,
triggerId,
source: {
projectId,
dir: './',
branchName,
},
});
Thanks!

More Related Content

PDF
Google Cloud Build - Sfeir Lunch Janvier 2019
PDF
Ci/CD - Stop wasting time, Automate your deployments
PPTX
Cloud native buildpacks_collabnix
PPTX
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
PDF
AllTheTalks 2020: Buildpacks - container for everyone!
PDF
Docker at MoneyBird
PDF
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
PPTX
Building A Distributed Build System at Google Scale (StrangeLoop 2016)
Google Cloud Build - Sfeir Lunch Janvier 2019
Ci/CD - Stop wasting time, Automate your deployments
Cloud native buildpacks_collabnix
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
AllTheTalks 2020: Buildpacks - container for everyone!
Docker at MoneyBird
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
Building A Distributed Build System at Google Scale (StrangeLoop 2016)

Similar to Google Cloud Build - Overview and Examples (20)

PPTX
Cloud Info Session PPT.pptx
PDF
CI/CD on Google Cloud Platform
PPTX
Cloud native buildpacks-cncf
PDF
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
PPTX
Настройка окружения для кросскомпиляции проектов на основе docker'a
PDF
Making cloud native deployments easy with Buildpack
PPTX
Introduction to GCCP - 2022.pptx
PPTX
Using Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build Times
PDF
Rebuild presentation - IoT Israel MeetUp
PDF
Powerful Google Cloud tools for your hack
PDF
Kubernetes Boulder - Kit Merker - Cloud Native Deployment
PDF
Microservices DevOps on Google Cloud Platform
PPTX
Introduction to JIB and Google Cloud Run
PDF
Introduction to Cloud Computing with Google Cloud
PDF
Let's make it flow ... one way
PDF
LXC to Docker Via Continuous Delivery
PDF
Building a Distributed Build System at Google Scale
PDF
Docker, Kubernetes, and Google Cloud
PDF
GCP-DevOps-projectintroduxtionfir devopsproject.pdf
PDF
Why You Should be Using Multi-stage Docker Builds in 2019
Cloud Info Session PPT.pptx
CI/CD on Google Cloud Platform
Cloud native buildpacks-cncf
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
Настройка окружения для кросскомпиляции проектов на основе docker'a
Making cloud native deployments easy with Buildpack
Introduction to GCCP - 2022.pptx
Using Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build Times
Rebuild presentation - IoT Israel MeetUp
Powerful Google Cloud tools for your hack
Kubernetes Boulder - Kit Merker - Cloud Native Deployment
Microservices DevOps on Google Cloud Platform
Introduction to JIB and Google Cloud Run
Introduction to Cloud Computing with Google Cloud
Let's make it flow ... one way
LXC to Docker Via Continuous Delivery
Building a Distributed Build System at Google Scale
Docker, Kubernetes, and Google Cloud
GCP-DevOps-projectintroduxtionfir devopsproject.pdf
Why You Should be Using Multi-stage Docker Builds in 2019
Ad

Recently uploaded (20)

PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Nekopoi APK 2025 free lastest update
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Digital Strategies for Manufacturing Companies
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Odoo POS Development Services by CandidRoot Solutions
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Nekopoi APK 2025 free lastest update
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
How Creative Agencies Leverage Project Management Software.pdf
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
How to Choose the Right IT Partner for Your Business in Malaysia
Which alternative to Crystal Reports is best for small or large businesses.pdf
Understanding Forklifts - TECH EHS Solution
Design an Analysis of Algorithms I-SECS-1021-03
Softaken Excel to vCard Converter Software.pdf
Upgrade and Innovation Strategies for SAP ERP Customers
Design an Analysis of Algorithms II-SECS-1021-03
Digital Strategies for Manufacturing Companies
Navsoft: AI-Powered Business Solutions & Custom Software Development
2025 Textile ERP Trends: SAP, Odoo & Oracle
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Ad

Google Cloud Build - Overview and Examples

  • 1. Overview and Examples Evgenii Studitskikh Full Stack developer at Rounds
  • 2. What is Cloud Build? Cloud Build is Google Cloud Platform's fully managed CI/CD platform that allows you to build, test, and deploy applications across multiple environments and programming languages.
  • 3. Key Features ● Execute builds in a fully managed environment ● Support of Docker containers ● YAML-based build configuration files (cloudbuild.yaml) ● Direct integration with Google Cloud Storage ● Cloud Logging and Monitoring integration
  • 4. What’s Under the Hood? ● Docker Containers: Each build step runs inside an isolated container. ● Kubernetes Engine: The build infrastructure scales dynamically based on its workload. ● Cloud Storage: It stores artifacts and logs for easy retrieval and auditing. ● IAM & Security: Access control with Identity and Access Management (IAM). ● Cloud Pub/Sub: Used for event-driven build triggers and notifications. ● Cloud Logging & Monitoring: Provides real-time log streaming and observability for debugging and performance analysis.
  • 5. How to run the build? ● Automatically via GitHub, Bitbucket, etc. ● Manually through CLI or code.
  • 6. Build triggers ● Name, Region, Description, Tags ● Event (repository event that invokes trigger) ○ Push to a repo branch, new tag, pull request ○ Manual invocation ○ Pub/Sub message ○ Webhook event ● Configuration ○ File (yaml or json) ○ Dockerfile, Buildpacks (only for repositories) ● Substitution variables ● Service account
  • 7. How to configure the cloudbuild.yaml
  • 8. Cloudbuild.yaml steps: - name: gcr.io/cloud-builders/gsutil args: - cp - $_KEYSTORE_URL - /workspace/keystore.jks id: download-keystore - name: ubuntu args: - '-c' - | apt-get update && apt-get install -y unzip unzip file.zip # Get the most recently created folder from workspace folder_name=$(ls -dt */ 2>/dev/null | head -n 1 | xargs basename) mv $folder_name android_app id: unzip-source-code entrypoint: sh timeout: 3600s logsBucket: 'gs://build-logs/$BUILD_ID' artifacts: objects: location: 'gs://build-artifacts/$BUILD_ID' paths: - /workspace/android_app/app/build/outputs/apk/release/** - /workspace/android_app/app/build/outputs/bundle/release/** Explanation: # (name) Defines the container image to be used for that step (More builders: gcr.io/cloud-builders) # Copies a file from a given URL # ($)Environment variable storing the URL of the keystore file # Destination path inside the build workspace (root dir) # Step identifier # Executes a multi-line command in the shell # Uses the shell as the entrypoint # Sets a timeout limit for the build process # Stores logs in a Cloud Storage bucket # Specifies where build artifacts are stored # Uploads release APK files # Uploads release bundle files
  • 9. Build logs ● Cloud Build provides real-time logging of each step execution. ● Logs are streamed to Cloud Logging and can be viewed in the GCP Console. ● Errors and warnings are highlighted to help with debugging. ● Logs are stored in a specified Cloud Storage bucket (logsBucket parameter).
  • 10. Integration with Node.js Installing the client library: npm install @google-cloud/cloudbuild Using the client library: const {CloudBuildClient} = require('@google-cloud/cloudbuild'); const [resp] = await cb.runBuildTrigger({ projectId, triggerId, source: { projectId, dir: './', branchName, }, });