EvgeniiStuditskikh
34 views
11 slides
Feb 24, 2025
Slide 1 of 11
1
2
3
4
5
6
7
8
9
10
11
About This Presentation
Google Cloud Build: Your Complete CI/CD Pipeline Solution in the Cloud
Discover how Google Cloud Build revolutionizes continuous integration and continuous delivery (CI/CD) with its fully managed, serverless platform. This comprehensive presentation explores Cloud Build's architecture, features,...
Google Cloud Build: Your Complete CI/CD Pipeline Solution in the Cloud
Discover how Google Cloud Build revolutionizes continuous integration and continuous delivery (CI/CD) with its fully managed, serverless platform. This comprehensive presentation explores Cloud Build's architecture, features, and real-world implementations for streamlined software delivery.
Learn how Cloud Build integrates with GitHub, Bitbucket, and Cloud Source Repositories, enabling automatic builds triggered by code commits. The platform supports multiple programming languages and frameworks, including Java, Python, Node.js, and Go, making it versatile for diverse development teams.
Through practical examples and demonstrations, attendees will learn to:
Set up automated build triggers for different environments
Implement parallel and sequential build steps
Integrate testing frameworks and quality gates
Manage artifacts across Google Cloud services
Monitor build metrics and optimize pipeline efficiency
The presentation includes case studies and advanced topics covering Cloud Build's integration with Cloud Run, Google Kubernetes Engine (GKE), and Cloud Functions. Perfect for developers, DevOps engineers, and technical leaders looking to streamline their development pipeline.
Size: 505.64 KB
Language: en
Added: Feb 24, 2025
Slides: 11 pages
Slide Content
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 stor es 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, }, });