Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Earthfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
VERSION 0.8

PROJECT earthly-technologies/cloud

FROM golang:1.16-alpine3.13
WORKDIR /go-example

Expand Down Expand Up @@ -25,4 +29,4 @@ docker:
# Demo for Google Cloud Build, showing use of a dedicated service account
gcp-cloudbuild:
FROM gcr.io/cloud-builders/gsutil
RUN --mount type=secret,id=+secrets/earthly-technologies/google/cloudbuild-service-key,target=/root/key.json gcloud auth activate-service-account --key-file=/root/key.json && gsutil ls -p earthly-jupyterlab
RUN --mount type=secret,id=google/cloudbuild-service-key,target=/root/key.json gcloud auth activate-service-account --key-file=/root/key.json && gsutil ls -p earthly-jupyterlab
23 changes: 20 additions & 3 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
steps:
- id: 'build'
name: 'earthly/earthly:v0.5.24'
name: 'earthly/earthly:v0.8.7'
env:
- "HOME=/root"
args:
- --allow-privileged
- --ci
# - --push # Uncomment to allow GCP to push images to your choice of repository. Secrets for your repository must be configured.
- +docker

- id: 'secrets'
name: 'earthly/earthly:v0.8.7'
env:
- "HOME=/root"
- "EARTHLY_PROJECT=cloud"
args:
- secrets
- ls
secretEnv:
- 'EARTHLY_TOKEN'

- id: 'gcp-test'
name: 'earthly/earthly:v0.5.24'
name: 'earthly/earthly:v0.8.7'
env:
- "HOME=/root"
args:
- +gcp-cloudbuild
secretEnv:
- 'EARTHLY_TOKEN'

availableSecrets:
secretManager:
- versionName: projects/earthly-jupyterlab/secrets/EARTHLY_TOKEN/versions/2
- versionName: projects/earthly-jupyterlab/secrets/EARTHLY_TOKEN/versions/4
env: 'EARTHLY_TOKEN'