cloud-build-local

command module
v0.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2017 License: Apache-2.0 Imports: 21 Imported by: 0

README

Google Cloud Container Builder Local Builder

Local Builder runs Google Cloud Container Builder builds locally, allowing easier debugging, execution of builds on your own hardware, and integration into local build and test workflows.


Prerequisites

  • gcloud
  • docker
  • go (if you build the tool yourself)

If the build needs to access a private GCR registry, install and configure the Docker credential helper for GCR users.

The local builder uses gcloud information to set up a spoofed metadata server, so you have to set the project:

gcloud config set project my-project

Install using gcloud

gcloud components install container-builder-local

After successful installation, you will have container-builder-local setup on your PATH (as part of the Google Cloud SDK binaries), so you will be able to run it with:

$ container-builder-local

Download the latest binaries

The latest binaries are available in a GCS bucket.

Download the latest binaries from GCS.

To run a build:

./container-builder-local_{linux,darwin}_{386,amd64}-v<latest_tag> --dryrun=false --config=path/to/cloudbuild.yaml path/to/code

Developing Local Builder

To build and develop Local Builder, you need a working Go environment.

Run the following commands to install the tool:

go get github.com/GoogleCloudPlatform/container-builder-local
go install github.com/GoogleCloudPlatform/container-builder-local

To run a build:

./bin/container-builder-local --dryrun=false --config=path/to/cloudbuild.yaml path/to/code

To run the tests (without the vendored libraries):

go test $(go list github.com/GoogleCloudPlatform/container-builder-local/... | grep -v vendor)

Limitations

  • Only one build can be run at a time on a given host.
  • The tool doesn't work on Windows yet, PR welcome.

Support

File issues here, e-mail gcr-contact@google.com, or join our Slack channel if you have general questions about Local Builder or Container Builder.

Documentation

Overview

Package main runs the gcb local builder.

Directories

Path Synopsis
Package build implements the logic for executing a single user build.
Package build implements the logic for executing a single user build.
Package buildlog implements a pub/sub log that can have multiple readers and multiple writers.
Package buildlog implements a pub/sub log that can have multiple readers and multiple writers.
Package common shares methods for local builder.
Package common shares methods for local builder.
Package config provides methods to read a cloudbuild file and convert it to a build proto.
Package config provides methods to read a cloudbuild file and convert it to a build proto.
Package gcloud provides methods to interact with local installed gcloud.
Package gcloud provides methods to interact with local installed gcloud.
Package metadata provides methods to deal with a metadata container server.
Package metadata provides methods to deal with a metadata container server.
Package runner implements method to run commands.
Package runner implements method to run commands.
Package subst does string substituion in build fields.
Package subst does string substituion in build fields.
Package validate provides methods to validate a build.
Package validate provides methods to validate a build.
Package volume provides methods to deal with docker volumes.
Package volume provides methods to deal with docker volumes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL