diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2015-03-18 11:24:02 +0000 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2015-03-18 11:24:02 +0000 |
commit | 384e325fc0c95689b1856001d84c459b66ec9a71 (patch) | |
tree | 4ba3341d57f8db29104829a0079146f5f7e5da3a | |
parent | 4aa90503e2b948b90c99598748a658c7d172f463 (diff) | |
download | sariulclocks-384e325fc0c95689b1856001d84c459b66ec9a71.tar.gz |
deploy script enhanced
-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 |