From f9209e505ca8491a1f979da332f2e68ef5fcfe7a Mon Sep 17 00:00:00 2001 From: Alexander Babai Date: Thu, 1 Nov 2018 07:30:04 +0300 Subject: [PATCH] Versioned docs releases - full site copy (#240) * refactor(*): versioned releases use full site copy insted on content post-processing add steps to build versioned docs copy to codefresh pipeline * fix makefile --- .gitignore | 1 - Makefile | 12 +----------- codefresh.yml | 16 ++++++++++++++++ 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index f7c8c0adc..5b05a4fe7 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,3 @@ themes/cloudposse/static/js/* static/webfonts/* static/css/* static/js/* -content/release/* diff --git a/Makefile b/Makefile index 32b0caa27..9c52caaa4 100644 --- a/Makefile +++ b/Makefile @@ -126,18 +126,8 @@ components/build: utterances/build \ front/build @exit 0 -content/release-copy: -ifeq ($(SEMVERSION_TAG),) - @exit 0 -else - mkdir -p release/$(SEMVERSION_TAG) - cp -r content/* release/$(SEMVERSION_TAG) - mv release content -endif - ## Generate all static content (outputs to public/) using local environment -hugo/build: components/build \ - content/release-copy +hugo/build: components/build @[ "$(HUGO_PUBLISH_DIR)" != "/" ] || (echo "Invalid HUGO_PUBLISH_DIR=$(HUGO_PUBLISH_DIR)"; exit 1) rm -rf $(HUGO_PUBLISH_DIR) $(HUGO) --templateMetrics --stepAnalysis --config $(HUGO_CONFIG) diff --git a/codefresh.yml b/codefresh.yml index 76e21c2a0..8c6c1c3e8 100644 --- a/codefresh.yml +++ b/codefresh.yml @@ -38,6 +38,22 @@ steps: - make release - make hugo/build + build_versioned_release: + title: Building Hugo static site... + image: '${{build_image}}' + working_directory: ./ + environment: + - "HUGO_URL=${{HUGO_URL}}/release/${{SEMVERSION_TAG}}" + - "HUGO_PUBLISH_DIR=${{HUGO_PUBLISH_DIR}}/release/${{SEMVERSION_TAG}}" + commands: + - make lint + - make release + - make hugo/build + when: + condition: + all: + executeForTag: "'${{SEMVERSION_TAG}}' != ''" + test: title: Running tests... image: '${{build_image}}'