Skip to content

Commit

Permalink
Remove faking the GOPATH step in cloudbuild yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
aLekSer committed Apr 8, 2020
1 parent 3c5a86f commit 9976785
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
6 changes: 3 additions & 3 deletions build/includes/website.mk
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ site-gen-app-yaml:

site-deploy: site-gen-app-yaml site-static
docker run -t --rm $(common_mounts) --workdir=$(mount_path) $(DOCKER_RUN_ARGS) \
-e GOPATH=/tmp/go -e GO111MODULE=on -e SHORT_SHA=$(shell git rev-parse --short=7 HEAD) $(build_tag) bash -c \
'printenv && mkdir -p $$GOPATH/src && cp -r ./site $$GOPATH/src && \
cd $$GOPATH/src/site && gcloud app deploy .app.yaml --no-promote --quiet --version=$$SHORT_SHA'
-e GO111MODULE=on -e SHORT_SHA=$(shell git rev-parse --short=7 HEAD) $(build_tag) bash -c \
'printenv && cd ./site && \
gcloud app deploy .app.yaml --no-promote --quiet --version=$$SHORT_SHA'

site-static-preview:
$(MAKE) site-static ARGS="-F" ENV="RELEASE_VERSION=$(base_version) RELEASE_BRANCH=master"
Expand Down
9 changes: 2 additions & 7 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,16 +216,11 @@ steps:
- tests
dir: "build"
args: ["site-static-preview", "site-gen-app-yaml", "SERVICE=preview"]
- name: "ubuntu" # fake a new gopath
id: site-gopath
waitFor:
- site-static
args: ["bash", "-c", "mkdir -p ./go/src && mv ./site ./go/src && ls -a ./go/src/site"]
- name: "gcr.io/cloud-builders/gcloud" # deploy the preview of the website
id: "deploy-site-static"
waitFor:
- site-gopath
dir: "go/src/site"
- site-static
dir: "site"
args: ["app", "deploy", ".app.yaml", "--no-promote", "--version=$SHORT_SHA"]
env:
- GOPATH=/workspace/go
Expand Down
10 changes: 4 additions & 6 deletions site/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@ steps:
- name: "make-docker" # build production version of the site
dir: "build"
args: ["site-static", "site-gen-app-yaml", "ENV=HUGO_ENV=production"]
- name: "ubuntu" # fake a new gopath
args: ["bash", "-c", "mkdir -p ./go/src && cp -r ./site ./go/src && cp -r ./vendor/gopkg.in ./go/src && ls -a ./go/src/site"]
- name: "gcr.io/cloud-builders/gcloud" # deploy the website
dir: "go/src/site"
dir: "site"
args: ["app", "deploy", ".app.yaml", "--promote", "--version=$SHORT_SHA"]
env:
- GOPATH=/workspace/go
- GO111MODULE=on

#
# Build development site and deploy
Expand All @@ -54,12 +53,11 @@ steps:
- name: "make-docker" # build a preview of the website
dir: "build"
args: ["site-static-preview", "site-gen-app-yaml", "SERVICE=development"]
- name: "ubuntu" # fake a new gopath
args: ["bash", "-c", "rm -r ./go/src && mkdir -p ./go/src && cp -r ./site ./go/src && ls -a ./go/src/site"]
- name: "gcr.io/cloud-builders/gcloud" # deploy the preview of the website
dir: "go/src/site"
dir: "site"
args: ["app", "deploy", ".app.yaml", "--promote", "--version=$SHORT_SHA"]
env:
- GOPATH=/workspace/go
- GO111MODULE=on

tags: ["site"]

0 comments on commit 9976785

Please sign in to comment.