From 0ee38903c760b8ec1dd016c584ae2cc30c0f1200 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Sat, 16 Apr 2022 11:10:25 +0530 Subject: [PATCH] fix: add CI environment check on make ci-deploy --- .woodpecker.yml | 1 + Makefile | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index ce4df9b..3230dc4 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -6,4 +6,5 @@ pipeline: commands: - make env - make + - ls -lah && find scripts && cat scripts/ci.sh - make ci-deploy diff --git a/Makefile b/Makefile index 285581e..977d562 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,10 @@ clean: ## Clean build assets ./scripts/zola.sh clean ci-deploy: ## Deploy from CI/CD. Only call from within CI + @if [ "${CI}" != "woodpecker" ]; \ + then echo "Only call from within CI. Will re-write your local Git configuration. To override, set export CI=woodpecker"; \ + exit 1; \ + fi git config --global user.email "${CI_COMMIT_AUTHOR_EMAIL}" git config --global user.name "${CI_COMMIT_AUTHOR}" ./scripts/zola.sh deploy pages public "${CI_COMMIT_AUTHOR} <${CI_COMMIT_AUTHOR_EMAIL}>"