commit cc0aa73689aba16b3e8a10788515a591981f28ad (patch)
parent 3266428b62d75c95732b0f1188c64a498d8c176f
Author: Alex Karle <alex@karle.co>
Date: Sat, 30 May 2020 14:10:39 -0400
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.
Diffstat:
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git 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
@@ -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