Skip to content

CloudBuildr/google-custom-builders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This repository contains source code for custom builders. You can use these images as build steps for Google Cloud Build.

These are not official Google products.

How to use a custom builder

Google Cloud Build executes a build as a series of build steps. Each build step is run in a Docker container. See the Cloud Build documentation for more details about builds and build steps.

Before you begin

  1. Select or create a Google Cloud project.
  2. Enable billing for your project.
  3. Enable the Cloud Build API.
  4. Install and initialize the Cloud SDK.

Build the build step from source

To use a customer builder as a build step, you need to download the source code from this repo and build the image.

The example below shows how to download and build the image for the cdxgen build step on a Linux or Mac OS X workstation:

  1. Clone the cloud-builders-community repo:

    $ git clone https://github.com/CloudBuildr/google-custom-builders
  2. Go to the directory that has the source code for the cdxgen Docker image:

    $ cd google-custom-builders/cdxgen
  3. Build the Docker image:

    $ gcloud builds submit --config cloudbuild.yaml .
    
  4. View the image in Google Container Registry:

    $ gcloud container images list --filter cdxgen

Use the build step with Cloud Build build

Once you've built the Docker image, you can use it as a build step in a Cloud Build build.

For example, below is the cdxgen build step in a YAML config file, ready to be used in a Cloud Build build:

steps:
    - name: "gcr.io/$PROJECT_ID/cdxgen"
      args: ["--output", "bom.xml", "src"]

Updating the custom builders

The custom builders gets cached and stored in the container registry that belongs to the project. As the tools change it may become necessary to update the builders in your registry. To update simply run build docker image step again.

```
$ gcloud builds submit --config cloudbuild.yaml .
```

About

Custom builders for Google Cloud. Note: this repo is not officially related to Google.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published