From 77ff6151bd45eb68bc112357ec0a246f8aa206e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 19 May 2023 12:09:29 +0200 Subject: [PATCH] Fix `check-environment` `Makefile` rule Bunch of improvements to the `check-environment` rule: - it was listed as the first target in `Makefile`, causing it to be run when you just use `make`. It's now moved down to where it is first used. - Call with `$(MAKE) -s` so that there is less logging noise. - Use `@echo` so that there is less logging noise. - Change the example to set the right environment variable (it had a trailing underscore). --- .env.example | 2 +- Makefile | 29 +++++++++++++++-------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.env.example b/.env.example index 1ab823bb..110ef468 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,4 @@ # Copy this file as .env # SSH account & hostname for publishing. -WEBSERVER_SSH_=user@domain +WEBSERVER_SSH=user@domain WEBSERVER_ROOT=/path-to/flamenco.blender.org diff --git a/Makefile b/Makefile index 94ea9eee..5274ac0c 100644 --- a/Makefile +++ b/Makefile @@ -43,18 +43,6 @@ FFMPEG_VERSION=5.0.1 TOOLS=./tools TOOLS_DOWNLOAD=./tools/download -# For production deployments: check variables stored in .env -.PHONY: check-environment -check-environment: -ifndef WEBSERVER_SSH - echo "WEBSERVER_SSH not found. Check .env or .env.example" - exit 1 -endif -ifndef WEBSERVER_ROOT - echo "WEBSERVER_ROOT not found. Check .env or .env.example" - exit 1 -endif - all: application # Install generators and build the software. @@ -240,7 +228,7 @@ clean-webapp-static: touch ${WEB_STATIC}/emptyfile project-website: - $(MAKE) check-environment + $(MAKE) -s check-environment rm -rf web/project-website/public/ cd web/project-website; hugo --baseURL https://flamenco.blender.org/ rsync web/project-website/public/ ${WEBSERVER_SSH}:${WEBSERVER_ROOT}/ \ @@ -252,6 +240,19 @@ project-website: --exclude .htaccess \ --delete-after +# For production deployments: check variables stored in .env +.PHONY: check-environment +check-environment: +ifndef WEBSERVER_SSH + @echo "WEBSERVER_SSH not found. Check .env or .env.example" + exit 1 +endif +ifndef WEBSERVER_ROOT + @echo "WEBSERVER_ROOT not found. Check .env or .env.example" + exit 1 +endif + + # Download & install FFmpeg in the 'tools' directory for supported platforms. .PHONY: tools tools: @@ -350,7 +351,7 @@ release-package-windows: .PHONY: publish-release-packages publish-release-packages: - $(MAKE) check-environment + $(MAKE) -s check-environment cd dist; sha256sum ${RELEASE_PACKAGE_LINUX} ${RELEASE_PACKAGE_DARWIN} ${RELEASE_PACKAGE_WINDOWS} > ${RELEASE_PACKAGE_SHAFILE} cd dist; rsync -va \ ${RELEASE_PACKAGE_LINUX} ${RELEASE_PACKAGE_DARWIN} ${RELEASE_PACKAGE_WINDOWS} ${RELEASE_PACKAGE_SHAFILE} \