From 6275183b5976f1aec7b51032e4cf050c0a795dd3 Mon Sep 17 00:00:00 2001 From: Jacky Wu Date: Wed, 15 Jan 2020 20:47:33 +0800 Subject: [PATCH] refact: merge HUGO_VERSION, add deploy-preview. (#18020) --- Makefile | 5 ++++- netlify.toml | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 050eea92dc..c9dbeeda39 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/netlify.toml b/netlify.toml index 1c8898e0ce..22865e1f75 100644 --- a/netlify.toml +++ b/netlify.toml @@ -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