Skip to content

Instantly share code, notes, and snippets.

@Philmod
Created January 23, 2018 15:17
Show Gist options
  • Save Philmod/f3928949e5d29bd5cee0fc8d99a37927 to your computer and use it in GitHub Desktop.
Save Philmod/f3928949e5d29bd5cee0fc8d99a37927 to your computer and use it in GitHub Desktop.
Create a Go binary with GCB.
steps:
# Install dependencies.
- name: 'gcr.io/cloud-builders/go'
args: ['install', '.']
env: ['PROJECT_ROOT=hello']
# Run tests.
- name: 'gcr.io/cloud-builders/go'
args: ['test', 'hello']
env: ['PROJECT_ROOT=hello']
# Create binary.
- name: 'gcr.io/cloud-builders/go'
args: ['build', 'hello']
env: ['PROJECT_ROOT=hello']
# Run binary.
# - name: 'ubuntu'
# entrypoint: 'bash'
# args: ['-c', './hello']
# Copy binary to GCS.
- name: 'gcr.io/cloud-builders/gsutil'
args: ['-m', 'cp', 'hello', 'gs://my-bucket/']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment