Created
August 9, 2018 20:44
-
-
Save petomalina/bf893269a7223dd95e4a2e92aeba4aa2 to your computer and use it in GitHub Desktop.
Accelerating golang CI builds with GOCACHE and Cloud Storage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
steps: | |
- name: gcr.io/cloud-builders/gsutil | |
args: ['-m', '-q', 'cp', 'gs://your-caching-bucket/cache.tar.gz', '/workspace'] | |
- name: ubuntu | |
entrypoint: '/bin/bash' | |
args: ['-c', 'tar -xf cache.tar.gz'] | |
- name: ubuntu | |
entrypoint: '/bin/bash' | |
args: ['-c', 'mkdir bin'] | |
- name: golang:rc | |
entrypoint: 'go' | |
args: ['install', '-installsuffix', 'cgo', './...'] | |
env: | |
- 'GOCACHE=/workspace/.cache' | |
- 'CGO_ENABLED=0' | |
- 'GOOS=linux' | |
- name: ubuntu | |
entrypoint: '/bin/bash' | |
args: ['-c', 'tar -cf cache.tar.gz .cache'] | |
- name: gcr.io/cloud-builders/gsutil | |
args: ['-m', '-q', 'cp', '/workspace/cache.tar.gz', 'gs://your-caching-bucket'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment