Reader small image

You're reading from  Secure Continuous Delivery on Google Cloud

Product typeBook
Published inApr 2024
PublisherPackt
ISBN-139781805129288
Edition1st Edition
Concepts
Right arrow
Authors (3):
Giovanni Galloro
Giovanni Galloro
author image
Giovanni Galloro

Giovanni Galloro has been working at Google since 2017 as a customer engineer specializing in container-based runtimes, DevOps tools, and application networking. He works with multiple organizations across EMEA, helping them to leverage these capabilities and improve their software delivery practices. Giovanni is a community ambassador for the Continuous Delivery Foundation and is a frequent speaker at developer conferences. Before Google, he worked at Microsoft, Red Hat, VMware, and HP, following the evolution of application platforms over the past 20 years.
Read more about Giovanni Galloro

Nathaniel Avery
Nathaniel Avery
author image
Nathaniel Avery

Nathaniel Avery works at Google as an outbound product manager for the Google Cloud Application Ecosystem group, specializing in DevOps tools, and has spoken to many Fortune 500 companies about DevOps tooling solutions. Before joining Google, Nate spent more than 20 years in IT designing, planning, and implementing complex systems, integrating custom-built and COTS applications for federal government customers. Currently, he's working on better ways to build and use cloud resources to help customers deliver better products, safely and securely, without sacrificing velocity.
Read more about Nathaniel Avery

David Dorbin
David Dorbin
author image
David Dorbin

David Dorbin has been a technical writer for more than three decades. He's been with Google for more than a dozen years, documenting payment applications, internal tools, and Google Cloud DevOps products. Before Google, he worked with numerous start-ups and established companies, documenting technologies in payment processing, digital publishing and rights management, consumer electronics, and cryptography for financial institutions. In his free time, Dave enjoys playing bass and banjolele (but never at the same time), or doing more damage to his Achilles' heel on the streets and trails of northern New Jersey.
Read more about David Dorbin

View More author details
Right arrow

Integrating with Your Organization’s Workflows

In this chapter, we’ll show you how to integrate your software development pipeline with external systems that your organization might use to deliver continuous integration/continuous delivery (CI/CD).

For this chapter, we’ll use third-party source code management systems through a Cloud Build trigger. After a successful test execution, we’ll automate Cloud Deploy promotion and integrate Cloud Deploy approval with third-party workflow management tools using Cloud Pub/Sub.

This chapter includes references to third-party tools from non-Google vendors. Examples of third-party tools include source control repositories such as GitHub, GitLab, and BitBucket, and project-management tools such as Jira, ServiceNow, Remedy, and others. You can use these applications along with your CI/CD pipelines to support capabilities such as approval workflows and repository interactions.

Google Cloud’s first-party...

Technical requirements

To perform the tasks in this chapter, you’ll need a Google Cloud project with billing or a free trial enabled. You can reuse the project you’ve been using throughout this book. In addition to these items, and what you’ve already enabled in previous chapters, you’ll need the following:

  • An account on gitlab.com
  • A repository on gitlab.com
  • The Google Pub/Sub API enabled

The source code for this chapter is available in this book’s GitHub repository at https://github.com/PacktPublishing/Secure-Continuous-Delivery-on-Google-Cloud.

For our first look at third-party integration, we’ll connect a Cloud Build trigger to a non-Google source code repository: GitLab.

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:

  1. Create a host connection.
  2. Create a link to the repository.
  3. 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:

  1. In GitLab, create an api personal access token.
    1. Under User Settings...

Integrating Cloud Deploy with automated testing

Automated testing is an important part of a source-to-prod workflow. You can use deployment verification after any completed deployment to confirm that your deployment works as expected.

In addition to deployment verification, you can use deploy hooks to reach out to local or remote resources. Sometimes, you need to connect to a third-party service after deployment has been completed. Post-deploy hooks make that possible. As with verification, post-deploy hooks run from a user-defined container. Unlike verification, deploy hooks are intended for actions that only have an effect when they’re run for the first time, for a given release.

In the example in this section, the delivery pipeline uses a post-deploy hook to call an API from the Google PageSpeed Insights (PSI) tool. PSI assesses your website’s user experience across mobile and desktop environments while also providing suggestions to improve performance. This...

Integrating Cloud Deploy approval with third-party workflow management tools

Cloud Deploy uses Pub/Sub to communicate with other applications, including applications for third-party providers.

Pub/Sub is often used in event-driven programming. With Pub/Sub, an application publishes information (messages) to a topic, and other applications subscribe to that topic to receive the messages. Those other applications can use these messages to invoke actions. In this section, we’ll show you how to create a topic and subscribe to that topic via Pub/Sub.

Cloud Deploy publishes messages to the topics listed in the following table:

Summary

In this chapter, we examined how to expand the capabilities of a CI/CD pipeline more in line with real-world needs. You learned how to create a Cloud Build trigger on an external repository, integrate a Cloud Deploy delivery pipeline with automated testing, and use Pub/Sub to initiate an approval workflow with a third-party workflow management tool.

You might not need these more advanced topics immediately, but once your DevOps pipeline is running, you could find these helpful when it comes to improving the overall experience.

Connecting the pipeline to third-party tools extends the range of what’s possible. Many different third-party capabilities, such as Agile project management, metrics, source code repositories, and alerting tools, exist outside of the native capabilities of Google’s first-party software.

This chapter also touched on some of the advanced first-party options in Cloud Deploy, such as automation. These advanced first-party options,...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Secure Continuous Delivery on Google Cloud
Published in: Apr 2024Publisher: PacktISBN-13: 9781805129288
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (3)

author image
Giovanni Galloro

Giovanni Galloro has been working at Google since 2017 as a customer engineer specializing in container-based runtimes, DevOps tools, and application networking. He works with multiple organizations across EMEA, helping them to leverage these capabilities and improve their software delivery practices. Giovanni is a community ambassador for the Continuous Delivery Foundation and is a frequent speaker at developer conferences. Before Google, he worked at Microsoft, Red Hat, VMware, and HP, following the evolution of application platforms over the past 20 years.
Read more about Giovanni Galloro

author image
Nathaniel Avery

Nathaniel Avery works at Google as an outbound product manager for the Google Cloud Application Ecosystem group, specializing in DevOps tools, and has spoken to many Fortune 500 companies about DevOps tooling solutions. Before joining Google, Nate spent more than 20 years in IT designing, planning, and implementing complex systems, integrating custom-built and COTS applications for federal government customers. Currently, he's working on better ways to build and use cloud resources to help customers deliver better products, safely and securely, without sacrificing velocity.
Read more about Nathaniel Avery

author image
David Dorbin

David Dorbin has been a technical writer for more than three decades. He's been with Google for more than a dozen years, documenting payment applications, internal tools, and Google Cloud DevOps products. Before Google, he worked with numerous start-ups and established companies, documenting technologies in payment processing, digital publishing and rights management, consumer electronics, and cryptography for financial institutions. In his free time, Dave enjoys playing bass and banjolele (but never at the same time), or doing more damage to his Achilles' heel on the streets and trails of northern New Jersey.
Read more about David Dorbin

Topic

Description

clouddeploy-resources

Cloud Deploy sends a message when a resource is created, updated, or deleted – for example, when a delivery pipeline is created.

Clouddeploy-operations...