on master help sign in
Only perform nightly duplication checks after building
commitd5df74795c52c2c575c188a838bd257ffc82dd15 authorMichael Snoyman <michael@snoyman.com> dateSun 27 Mar 2016, 13:23 (11 years ago) parentad778da
1 file changed+15−2
automated/build.sh+15−2
automated/build.sh+15−2
@@ -82,8 +82,14 @@ ARGS_PREBUILD="$ARGS_COMMON -u $USER -v $CABAL_DIR:/home/stackage/.cabal -v $STA
8282ARGS_BUILD="$ARGS_COMMON -v $CABAL_DIR:/home/stackage/.cabal:ro -v $STACK_DIR:/home/stackage/.stack:ro -v $GHC_DIR:/home/stackage/.ghc:ro"
8383ARGS_UPLOAD="$ARGS_COMMON -u $USER -e AWS_ACCESS_KEY=$AWS_ACCESS_KEY -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY -e AWS_SECRET_KEY=$AWS_SECRET_KEY -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_KEY -v $AUTH_TOKEN:/auth-token:ro -v $HACKAGE_CREDS:/hackage-creds:ro -v $DOT_STACKAGE_DIR:/home/stackage/.stackage -v $SSH_DIR:/home/ubuntu/.ssh:ro -v $GITCONFIG:/home/stackage/.gitconfig:ro -v $CABAL_DIR:/home/stackage/.cabal:ro -v $STACK_DIR:/home/stackage/.stack:ro"
8484
85−# Make sure we actually need this snapshot
86−docker run $ARGS_UPLOAD $IMAGE /bin/bash -c "stackage-curator check-target-available --target $TARGET"
85+# Make sure we actually need this snapshot. We only check this for LTS releases
86+# since, for nightlies, we'd like to run builds even if they are unnecessary to
87+# get early warning information of upcoming failures. (See the duplicate check
88+# below for why this is safe.)
89+if [ $SHORTNAME = "lts" ]
90+then
91+ docker run $ARGS_UPLOAD $IMAGE /bin/bash -c "stackage-curator check-target-available --target $TARGET"
92+fi
8793
8894# Get latest stack
8995curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C $EXTRA_BIN_DIR '*/stack'
@@ -102,6 +108,13 @@ docker run $ARGS_PREBUILD $IMAGE /bin/bash -c "/home/stackage/bin/stack update &
102108# switch back to the current user
103109docker run $ARGS_BUILD $IMAGE /bin/bash -c "chown $USER /home/stackage && sudo -E -u $USER env \"PATH=\$PATH:/home/stackage/bin\" stackage-curator make-bundle --plan-file $PLAN_FILE --docmap-file $DOCMAP_FILE --bundle-file $BUNDLE_FILE --target $TARGET"
104110
111+# Make sure we actually need this snapshot. We used to perform this check
112+# exclusively before building. Now we perform it after as well for the case of
113+# nightly, where we don't perform this check beforehand. This is also slightly
114+# safer, in case someone else already uploaded a specific snapshot while we
115+# were building.
116+docker run $ARGS_UPLOAD $IMAGE /bin/bash -c "stackage-curator check-target-available --target $TARGET"
117+
105118# Successful build, so we need to:
106119#
107120# * Upload the docs to S3