@@ -14,7 +14,7 @@ APP_TARGET = $(patsubst cmd/gvisor-website/%,public/%,$(APP_SOURCE))
1414default : website
1515.PHONY : default
1616
17- website : all-upstream app public/ static
17+ website : all-upstream app static-production
1818.PHONY : website
1919
2020app : $(APP_TARGET )
@@ -44,8 +44,13 @@ content/docs/community/sigs: upstream/community $(wildcard upstream/community/si
4444$(APP_TARGET ) : public $(APP_SOURCE )
4545 cp -a cmd/gvisor-website/$(patsubst public/% ,% ,$@ ) public/
4646
47- public/ static : compatibility-docs node_modules config.toml $(shell find archetypes assets content themes -type f | sed 's/ /\\ /g')
47+ static-production : compatibility-docs node_modules config.toml $(shell find archetypes assets content themes -type f | sed 's/ /\\ /g')
4848 HUGO_ENV=" production" $(HUGO )
49+ .PHONY : static-production
50+
51+ static-staging : compatibility-docs node_modules config.toml $(shell find archetypes assets content themes -type f | sed 's/ /\\ /g')
52+ $(HUGO ) -b " https://staging-$( shell git branch | grep \* | cut -d ' ' -f2) -dot-gvisor-website.appspot.com"
53+ .PHONY : static-staging
4954
5055node_modules : package.json package-lock.json
5156 # Use npm ci because npm install will update the package-lock.json.
@@ -77,10 +82,17 @@ server: website
7782.PHONY : server
7883
7984# Deploy the website to App Engine.
80- deploy : $( APP_TARGET )
85+ deploy : website
8186 cd public && $(GCLOUD ) app deploy
8287.PHONY : deploy
8388
89+ # Stage the website to App Engine at a version based on the git branch name.
90+ stage : all-upstream app static-staging
91+ # Disallow indexing staged content.
92+ printf " User-agent: *\nDisallow: /" > public/static/robots.txt
93+ cd public && $(GCLOUD ) app deploy -v staging-$(shell git branch | grep \* | cut -d ' ' -f2) --no-promote
94+ .PHONY : stage
95+
8496# CI related Commmands
8597# #############################################################################
8698
0 commit comments