refact: merge HUGO_VERSION, add deploy-preview. (#18020)

pull/18707/head
Jacky Wu 2020-01-15 20:47:33 +08:00 committed by Kubernetes Prow Robot
parent f9a939c5cf
commit 6275183b59
2 changed files with 6 additions and 3 deletions

View File

@ -1,5 +1,5 @@
DOCKER = docker
HUGO_VERSION = 0.59.1
HUGO_VERSION = $(shell grep ^HUGO_VERSION netlify.toml | tail -n 1 | cut -d '=' -f 2 | tr -d " \"\n")
DOCKER_IMAGE = kubernetes-hugo
DOCKER_RUN = $(DOCKER) run --rm --interactive --tty --volume $(CURDIR):/src
NODE_BIN = node_modules/.bin
@ -18,6 +18,9 @@ build: ## Build site with production settings and put deliverables in ./public
build-preview: ## Build site with drafts and future posts enabled
hugo --buildDrafts --buildFuture
deploy-preview: check-hugo-versions ## Deploy preview site via netlify
hugo --enableGitInfo --buildFuture -b $(DEPLOY_PRIME_URL)
functions-build:
$(NETLIFY_FUNC) build functions-src

View File

@ -15,10 +15,10 @@ HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
[context.deploy-preview]
command = "hugo --enableGitInfo --buildFuture -b $DEPLOY_PRIME_URL"
command = "make deploy-preview"
[context.branch-deploy]
command = "hugo --enableGitInfo --buildFuture -b $DEPLOY_PRIME_URL"
command = "make deploy-preview"
[context.master]
# This context is triggered by the `master` branch and allows search indexing