summaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2019-04-29 10:00:02 -0700
committerIan Lewis <ianlewis@google.com>2019-05-07 14:47:50 +0900
commit0f5e7e011cd3f023fa69675c10ad022f0dc7f712 (patch)
tree626d7956c347996097c99a421cd39efa20df0c75 /Makefile
parent0b4eca7b32702a3d88435cc0afb0e169e5c274f0 (diff)
build: fix deploy target for Makefile
Because the go.mod and related files were not being copying, the packages are resolved within the current $GOROOT, which does not work. This change copies all application files, not just Go source files and app.yaml.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 8 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 6c708a977..7415fc653 100644
--- a/Makefile
+++ b/Makefile
@@ -5,21 +5,19 @@ NPM := npm
GCLOUD := gcloud
GCP_PROJECT := gvisor-website
-# Source Go files. example: main.go foo/bar.go
-GO_SOURCE = $(shell find cmd/gvisor-website -type f -name "*.go" | sed 's/ /\\ /g')
-# Target Go files. example: public/main.go public/foo/bar.go
-GO_TARGET = $(shell cd cmd/gvisor-website && find . -type f -name "*.go" | sed 's/ /\\ /g' | sed 's/^.\//public\//')
+# Source Go files, example: main.go, foo/bar.go.
+APP_SOURCE = $(wildcard cmd/gvisor-website/*)
+# Target Go files, example: public/main.go, public/foo/bar.go.
+APP_TARGET = $(patsubst cmd/gvisor-website/%,public/%,$(APP_SOURCE))
default: website
.PHONY: default
-website: all-upstream public/app.yaml $(GO_TARGET) public/static
+website: all-upstream $(APP_TARGET) public/static
.PHONY: website
public:
mkdir -p public
-public/app.yaml: public
- cp -vr cmd/gvisor-website/app.yaml public/
# Load repositories.
upstream:
@@ -39,8 +37,8 @@ content/docs/community/sigs: upstream/community $(wildcard upstream/community/si
cat upstream/community/sigs/$$file.md |grep -v -E '^# ' >> content/docs/community/sigs/$$file.md; \
done
-$(GO_TARGET): public $(GO_SOURCE)
- cd cmd/gvisor-website && find . -name "*.go" -exec cp --parents \{\} ../../public \;
+$(APP_TARGET): public $(APP_SOURCE)
+ cp -a cmd/gvisor-website/$(patsubst public/%,%,$@) public/
public/static: node_modules config.toml $(shell find archetypes assets content themes -type f | sed 's/ /\\ /g')
HUGO_ENV="production" $(HUGO)
@@ -56,7 +54,7 @@ server: all-upstream
.PHONY: server
# Deploy the website to App Engine.
-deploy: public/app.yaml
+deploy: $(APP_TARGET)
cd public && $(GCLOUD) app deploy
.PHONY: deploy