Merge remote-tracking branch 'origin' into nightly

This commit is contained in:
Jens Petersen 2016-12-10 11:01:17 +09:00
commit 08655aa010
5 changed files with 502 additions and 320 deletions

View File

@ -96,17 +96,21 @@ fi
# Get latest stack # Get latest stack
curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C $EXTRA_BIN_DIR '*/stack' curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C $EXTRA_BIN_DIR '*/stack'
# Do all of the pre-build actions: # Determine the new build plan unless NOPLAN is set
# #
# * Update the package index # * Update the package index
# * Create a new plan # * Create a new plan
if [ "${NOPLAN:-}x" = "x" ]
then
docker run $ARGS_PREBUILD $IMAGE /bin/bash -c "stack update && exec stackage-curator create-plan --plan-file $PLAN_FILE --target $TARGET ${CONSTRAINTS:-}"
fi
# Do the rest of the pre-build actions:
#
# * Check that the plan is valid # * Check that the plan is valid
# * Fetch all needed tarballs (the build step does not have write access to the tarball directory) # * Fetch all needed tarballs (the build step does not have write access to the tarball directory)
# * Do a single unpack to create the package index cache (again due to directory perms) # * Do a single unpack to create the package index cache (again due to directory perms)
if [ "${NOPLAN:-}x" = "x" ] docker run $ARGS_PREBUILD $IMAGE /bin/bash -c "stackage-curator check --plan-file $PLAN_FILE && stackage-curator fetch --plan-file $PLAN_FILE && cd /tmp && exec stack unpack random"
then
docker run $ARGS_PREBUILD $IMAGE /bin/bash -c "stack update && stackage-curator create-plan --plan-file $PLAN_FILE --target $TARGET ${CONSTRAINTS:-} && stackage-curator check --plan-file $PLAN_FILE && stackage-curator fetch --plan-file $PLAN_FILE && cd /tmp && exec stack unpack random"
fi
# Now do the actual build. We need to first set the owner of the home directory # Now do the actual build. We need to first set the owner of the home directory
# correctly, so we run the command as root, change owner, and then use sudo to # correctly, so we run the command as root, change owner, and then use sudo to
@ -128,11 +132,4 @@ docker run $ARGS_UPLOAD $IMAGE /bin/bash -c "exec stackage-curator check-target-
# * Register as a new Hackage distro # * Register as a new Hackage distro
docker run $ARGS_UPLOAD $IMAGE /bin/bash -c "stackage-curator upload-docs --target $TARGET --bundle-file $BUNDLE_FILE && stackage-curator upload-index --plan-file $PLAN_FILE --target $TARGET && stackage-curator upload-github --plan-file $PLAN_FILE --docmap-file $DOCMAP_FILE --target $TARGET && exec stackage-curator hackage-distro --plan-file $PLAN_FILE --target $TARGET" docker run $ARGS_UPLOAD $IMAGE /bin/bash -c "stackage-curator upload-docs --target $TARGET --bundle-file $BUNDLE_FILE && stackage-curator upload-index --plan-file $PLAN_FILE --target $TARGET && stackage-curator upload-github --plan-file $PLAN_FILE --docmap-file $DOCMAP_FILE --target $TARGET && exec stackage-curator hackage-distro --plan-file $PLAN_FILE --target $TARGET"
if [ $SHORTNAME = "lts" ]
then
echo "Running cron.sh (hiding verbose output)"
./cron.sh | grep -v '^Skipping'
echo "done."
fi
date date

View File

@ -2,14 +2,23 @@
set -eux set -eux
cd "$(dirname "${BASH_SOURCE[0]}")"
CRONDIR=$(pwd)/crondir CRONDIR=$(pwd)/crondir
mkdir -p $CRONDIR mkdir -p $CRONDIR
source aws.sh source aws.sh
IMAGE=fpco/stackage-server-prod:latest
docker pull $IMAGE
stack update
echo "Running stackage-server-cron..." echo "Running stackage-server-cron..."
echo "('tail -f $CRONDIR/stackage-server-cron.log' to watch)" echo "('tail -f $CRONDIR/stackage-server-cron.log' to watch)"
docker run --rm \ docker run --rm \
-v $CRONDIR:/home/ubuntu \ -v $CRONDIR:/home/ubuntu \
-w /home/ubuntu \ -v $HOME/.stack/indices:/home/ubuntu/.stack/indices:ro \
fpco/stackage-server-prod:latest \ --workdir /home/ubuntu \
-p 17834:17834 \
$IMAGE \
bash -c "useradd $(whoami) -u $(id -u); sudo -u $(whoami) env HOME=/home/ubuntu AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY bash -c '/usr/local/bin/stackage-server-cron 2>&1 | tee -a /home/ubuntu/stackage-server-cron.log'" bash -c "useradd $(whoami) -u $(id -u); sudo -u $(whoami) env HOME=/home/ubuntu AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY bash -c '/usr/local/bin/stackage-server-cron 2>&1 | tee -a /home/ubuntu/stackage-server-cron.log'"

View File

@ -5,12 +5,6 @@ cd "$(dirname "${BASH_SOURCE[0]}")"
while true; do while true; do
./build.sh nightly-$(date -u +%F) ./build.sh nightly-$(date -u +%F)
date date
echo
echo "Running cron.sh (hiding verbose output)"
./cron.sh > cron.log 2>&1 # | grep -v '^Skipping'
echo "done."
date
sleep 30m sleep 30m
echo
done done

File diff suppressed because it is too large Load Diff

View File

@ -45,6 +45,7 @@ apt-get install -y \
git \ git \
libadns1-dev \ libadns1-dev \
libaio1 \ libaio1 \
libalut-dev \
libasound2-dev \ libasound2-dev \
libblas-dev \ libblas-dev \
libbz2-dev \ libbz2-dev \