From cc0aa73689aba16b3e8a10788515a591981f28ad Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Sat, 30 May 2020 14:10:39 -0400 Subject: [PATCH] make: Add release-prod target to update prod This does a full release first, then restarts prod with a new env var to update itself to the version in preprod. Safe to run, will bail if someone is on the server. I just got tired of SSH-ing over and cutting the prod release manually. --- Makefile | 5 +++++ bin/restart.sh | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/Makefile b/Makefile index 57c3f5f..0fdd184 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,11 @@ release: build test ssh -o StrictHostKeyChecking=no www@euchre.live \ env FORCE=$(FORCE) sh /var/www/restart.sh preprod +.PHONY: release-prod +release-prod: release + ssh -o StrictHostKeyChecking=no www@euchre.live \ + env FORCE=$(FORCE) UPDATE=1 sh /var/www/restart.sh prod + .PHONY: clean clean: rm -rf build public/asset diff --git a/bin/restart.sh b/bin/restart.sh index bcac487..30d8d60 100755 --- a/bin/restart.sh +++ b/bin/restart.sh @@ -23,6 +23,13 @@ restart() { echo "Check!" fi + if [ -n "$UPDATE" ]; then + printf "%s" "Updating preprod -> prod..." + rm -rf $HOME/prod-el + cp -a $HOME/preprod-el $HOME/prod-el + echo "Check!" + fi + if [ $name = "preprod" ]; then export MOJO_MODE=development else -- libgit2 1.1.1