From 7c18f4b6b008d89c1578ff1823f7b0efd910fc02 Mon Sep 17 00:00:00 2001 From: Stackage Curators Date: Tue, 1 Nov 2016 09:20:39 +0000 Subject: [PATCH] Do pre-build actions even with NOPLAN=1 --- automated/build.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/automated/build.sh b/automated/build.sh index 61504a4e..731445d8 100755 --- a/automated/build.sh +++ b/automated/build.sh @@ -96,17 +96,21 @@ fi # Get latest 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 # * 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 # * 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) -if [ "${NOPLAN:-}x" = "x" ] -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 +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" # 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