From f49e0b3ed4da5112e15178e41d2df800700ab987 Mon Sep 17 00:00:00 2001 From: Kirill Zaborsky Date: Tue, 19 Mar 2019 09:51:21 +0300 Subject: [PATCH] build.sh variant with the new curator version (and new Stack) --- automated/build-next.sh | 150 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100755 automated/build-next.sh diff --git a/automated/build-next.sh b/automated/build-next.sh new file mode 100755 index 00000000..fd51f430 --- /dev/null +++ b/automated/build-next.sh @@ -0,0 +1,150 @@ +#!/usr/bin/env bash + +set -eu +x + +ROOT=$(cd $(dirname $0) ; pwd) +TARGET=$1 + +# For nightly-YYYY-MM-DD, tag should be nightly +# For lts-X.Y, tag should be ltsX +SHORTNAME=$(echo $TARGET | cut -d- -f 1) +if [ $SHORTNAME = "lts" ] +then + TAG=$(echo $TARGET | sed 's@^lts-\([0-9]*\)\.[0-9]*@lts\1@') +else + TAG=$SHORTNAME +fi + +IMAGE=commercialhaskell/stackage:$TAG + +CABAL_DIR=$ROOT/cabal +STACK_DIR=$ROOT/stack +GHC_DIR=$ROOT/ghc +DOT_STACKAGE_DIR=$ROOT/dot-stackage +WORKDIR=$ROOT/$TAG/work +# ssh key is used for committing snapshots (and their constraints) to Github +SSH_DIR=$ROOT/ssh +USERID=$(id -u) + +mkdir -p \ + "$CABAL_DIR" \ + "$STACK_DIR" \ + "$GHC_DIR" \ + "$DOT_STACKAGE_DIR" \ + "$WORKDIR" \ + "$SSH_DIR" + +GITCONFIG=$ROOT/gitconfig +cat >$GITCONFIG <