euchre-live

Euchre web-app for the socially distant family
git clone git://git.alexkarle.com/euchre-live.git
Log | Files | Refs | README | LICENSE

commit a1fed50211a1b2421384ec3fde9c1afd82744be3 (patch)
parent 484f7cf28ea747e3818a8130157b9b4947726ab1
Author: Alex Karle <alex@karle.co>
Date:   Wed, 22 Apr 2020 19:51:49 -0400

ci: Add build script and release recipe

After a few times, this got super painful to do by hand.

The current game plan is to do all the webpack building on the local dev
machine, as the VM has only 1G RAM and runs out of memory compiling the
scss (yikes).

Luckily, the whole idea of webpack is that it doesn't need to rebuild if
the JS doesn't change, so for our production env, we only need a subset
of the repository.

Diffstat:
M.gitignore | 3++-
MMakefile | 5+++++
Abuild.sh | 26++++++++++++++++++++++++++
3 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore @@ -1,4 +1,5 @@ node_modules public/asset tags - +/build/ +/build.*/ diff --git a/Makefile b/Makefile @@ -9,3 +9,8 @@ tags: test: perl -c gloat.pl perl t/Game.t + +.PHONY: release +release: + ./build.sh + scp -r build/* www@euchre.live:/var/www/euchre-live diff --git a/build.sh b/build.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# build.sh -- build webpack assets +set -e +die() { + echo "$1" 1>&2 + exit 1 +} + +[ -e "gloat.pl" ] || die "Must be in root of euchre-live" + +# Set env vars to force a production build +# export MOJO_MODE=${MOJO_MODE:="production"} # TODO: use in server +export MOJO_WEBPACK_VERBOSE=1 +export MOJO_WEBPACK_BUILD=1 + +# Run an effectively no-op (non daemonizing) command to kick it off +./gloat.pl routes + +# Make the build directory +[ -d "build" ] && mv build build.`date +%s` +mkdir build +cp -a public lib gloat.pl build + +echo "---------------------------------------------------------------" +echo " Build Success!" +echo "---------------------------------------------------------------"