on master help sign in
Do pre-build actions even with NOPLAN=1
commit7c18f4b6b008d89c1578ff1823f7b0efd910fc02 authorStackage Curators <michael@snoyman.com> dateTue 1 Nov 2016, 09:20 (10 years ago) parent93bcefe
1 file changed+9−5
automated/build.sh+9−5
automated/build.sh+9−5
@@ -96,18 +96,22 @@ fi
9696# Get latest stack
9797curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C $EXTRA_BIN_DIR '*/stack'
9898
99−# Do all of the pre-build actions:
99+# Determine the new build plan unless NOPLAN is set
100100#
101101# * Update the package index
102102# * Create a new plan
103−# * Check that the plan is valid
104−# * Fetch all needed tarballs (the build step does not have write access to the tarball directory)
105−# * Do a single unpack to create the package index cache (again due to directory perms)
106103if [ "${NOPLAN:-}x" = "x" ]
107104then
108− 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"
105+ docker run $ARGS_PREBUILD $IMAGE /bin/bash -c "stack update && exec stackage-curator create-plan --plan-file $PLAN_FILE --target $TARGET ${CONSTRAINTS:-}"
109106fi
110107
108+# Do the rest of the pre-build actions:
109+#
110+# * Check that the plan is valid
111+# * Fetch all needed tarballs (the build step does not have write access to the tarball directory)
112+# * Do a single unpack to create the package index cache (again due to directory perms)
113+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"
114+
111115# Now do the actual build. We need to first set the owner of the home directory
112116# correctly, so we run the command as root, change owner, and then use sudo to
113117# switch back to the current user