diff options
-rwxr-xr-x | deploy.sh | 56 |
1 files changed, 48 insertions, 8 deletions
@@ -1,12 +1,52 @@ -#!/bin/sh +#!/bin/bash +. $HOME/.shenv -# simple deploy script for demeter +# simple deploy script: first make sure GHC and cabal are available +# (on the MetaArray, see comproc.org "MetaArray Haskell") +# 1. choose where to deploy + +live="~/html/sariul" +devel="~/html/sariul-devel" + +if [ "$1" = "live" ]; then + dest="$live" +else + if [ "$1" = "devel" ]; then + dest="$devel" + else + echo "Please supply one of \`devel', \`live' cmd line args" >&2 + exit 1 + fi +fi + +cd ~/src/sariulclocks +mkdir -p $dest + +# 2. build our software + +if ! [ -d ".cabal-sandbox" ]; then + cabal sandbox init +fi +cabal install --only-dependencies +cabal configure cabal build -cp -RL assets/* assets/.htaccess dist/build/sariulclocks.cgi/sariulclocks.cgi $HOME/html/ +# TODO: make this build actually work on ma! Missing librt. In the +# meantime, manually copy sariulclocks.cgi into place from demeter. + +# 3. copy our software into place + +cp -RL assets/* assets/.htaccess dist/build/sariulclocks.cgi/sariulclocks.cgi $dest # TODO: run strip on binary -cp -RL ../schoolclock/sounds $HOME/html -mkdir -p $HOME/html/data -chmod 777 $HOME/html/data -# TODO: this script takes "devel" and "live" arguments to deploy live version or a copy for testing new code (into maybe http://spw.sdf.org/sariul-devel/) -# TODO: also put script that resets clocks and deducts points at the end of the week into ~/local/bin ready to be cronned +cp -RL ../schoolclock/sounds $dest + +# 4. further permissions & dirs + +cd $HOME +# mkhomepg -p +mkdir -p $dest/data +chmod 777 $dest/data +chmod 755 $dest/sariulclocks.cgi + +# TODO: also put script that resets clocks and deducts points at the +# end of the week into ~/local/bin ready to be cronned |