on master help sign in
Better method for downloading curator and stack exes
41a56f8Michael Snoyman
automated/build-next.sh+16−30
@@ -63,20 +63,19 @@ require_400_file "$HACKAGE_CREDS"
63mkdir -p $ROOT/bin
63mkdir -p $ROOT/bin
64BINDIR=$(cd $ROOT/bin ; pwd)
64BINDIR=$(cd $ROOT/bin ; pwd)
65(
65(
66+CURATOR_EXES=95a207fb4d5bd2e2a255350ce18f55976344eeb71e6f27a25f63e8dba28a4cd1
66cd $BINDIR
67cd $BINDIR
67−rm -f stackage-curator stackage-curator-2*.bz2
68+rm -f curator stack *.bz2
68−CURATOR2=stackage-curator-2-f6258124cff9a7e92bcb5704164a70e149080e88
69−wget "https://download.fpcomplete.com/stackage-curator-2/$CURATOR2.bz2"
69+wget "https://s3.amazonaws.com/download.fpcomplete.com/curator-exes/curator-exes-$CURATOR_EXES.tar.bz2"
70−bunzip2 "$CURATOR2.bz2"
70+tar xf "curator-exes-$CURATOR_EXES.tar.bz2"
71−chmod +x $CURATOR2
71+echo curator: $(./curator --version)
72−mv $CURATOR2 stackage-curator
72+echo stack: $(./stack --version)
73−./stackage-curator --version
74)
73)
75
74
76# We share pantry directory between snapshots while the other content in .stack
75# We share pantry directory between snapshots while the other content in .stack
77# is stored separately (because e.g. Ubuntu releases between LTS and nightly
76# is stored separately (because e.g. Ubuntu releases between LTS and nightly
78# could differ). Also the order of binds is important.
77# could differ). Also the order of binds is important.
79−ARGS_COMMON="--rm -v $WORKDIR:$HOME/work -w $HOME/work -v $BINDIR/stackage-curator:/usr/bin/stackage-curator:ro -v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro -v $BINDIR/stack:/usr/bin/stack:ro -v $STACK_DIR:$HOME/.stack -v $PANTRY_DIR:$HOME/.stack/pantry"
78+ARGS_COMMON="--rm -v $WORKDIR:$HOME/work -w $HOME/work -v $BINDIR/curator:/usr/bin/curator:ro -v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro -v $BINDIR/stack:/usr/bin/stack:ro -v $STACK_DIR:$HOME/.stack -v $PANTRY_DIR:$HOME/.stack/pantry"
80ARGS_PREBUILD="$ARGS_COMMON -u $USERID -e HOME=$HOME -v $CABAL_DIR:$HOME/.cabal -v $GHC_DIR:$HOME/.ghc -v $DOT_STACKAGE_DIR:$HOME/.stackage"
79ARGS_PREBUILD="$ARGS_COMMON -u $USERID -e HOME=$HOME -v $CABAL_DIR:$HOME/.cabal -v $GHC_DIR:$HOME/.ghc -v $DOT_STACKAGE_DIR:$HOME/.stackage"
81ARGS_BUILD="$ARGS_COMMON -v $CABAL_DIR:$HOME/.cabal:ro -v $GHC_DIR:$HOME/.ghc:ro"
80ARGS_BUILD="$ARGS_COMMON -v $CABAL_DIR:$HOME/.cabal:ro -v $GHC_DIR:$HOME/.ghc:ro"
82# instance-data is an undocumented feature of S3 used by amazonka,
81# instance-data is an undocumented feature of S3 used by amazonka,
@@ -89,21 +88,9 @@ ARGS_UPLOAD="$ARGS_COMMON -u $USERID -e HOME=$HOME -v $HACKAGE_CREDS:/hackage-cr
89# below for why this is safe.)
88# below for why this is safe.)
90if [ $SHORTNAME = "lts" ]
89if [ $SHORTNAME = "lts" ]
91then
90then
92− docker run $ARGS_UPLOAD $IMAGE /bin/bash -c "exec stackage-curator check-target-available --target $TARGET"
91+ docker run $ARGS_UPLOAD $IMAGE /bin/bash -c "exec curator check-target-available --target $TARGET"
93fi
92fi
94
93
95−# Get latest stack
96−(
97−cd $BINDIR
98−rm -f stack stack-*.bz2
99−STACK=stack-f6258124cff9a7e92bcb5704164a70e149080e88
100−wget "https://download.fpcomplete.com/stackage-curator-2/$STACK.bz2"
101−bunzip2 "$STACK.bz2"
102−chmod +x $STACK
103−mv $STACK stack
104−./stack --version
105−)
106−
107
94
108# Determine the new build plan unless NOPLAN is set
95# Determine the new build plan unless NOPLAN is set
109#
96#
@@ -113,12 +100,12 @@ if [ "${NOPLAN:-}x" = "x" ]
113then
100then
114 if [ $SHORTNAME = "lts" ]
101 if [ $SHORTNAME = "lts" ]
115 then
102 then
116− docker run $ARGS_PREBUILD $IMAGE /bin/bash -c "stackage-curator constraints --target $TARGET && stackage-curator snapshot-incomplete && stackage-curator snapshot"
103+ docker run $ARGS_PREBUILD $IMAGE /bin/bash -c "curator constraints --target $TARGET && curator snapshot-incomplete --target $TARGET && curator snapshot"
117 else
104 else
118− docker run $ARGS_PREBUILD $IMAGE /bin/bash -c "stackage-curator update && stackage-curator constraints --target $TARGET && stackage-curator snapshot-incomplete && stackage-curator snapshot"
105+ docker run $ARGS_PREBUILD $IMAGE /bin/bash -c "curator update && curator constraints --target $TARGET && curator snapshot-incomplete --target $TARGET && curator snapshot"
119 fi
106 fi
120else
107else
121− docker run $ARGS_PREBUILD $IMAGE /bin/bash -c "stackage-curator snapshot"
108+ docker run $ARGS_PREBUILD $IMAGE /bin/bash -c "curator snapshot"
122fi
109fi
123
110
124
111
@@ -126,7 +113,7 @@ fi
126#
113#
127# * Check that the snapshot is valid
114# * Check that the snapshot is valid
128# * Fetch and unpack all needed tarballs (the build step does not have write access to the tarball directory)
115# * Fetch and unpack all needed tarballs (the build step does not have write access to the tarball directory)
129−docker run $ARGS_PREBUILD $IMAGE /bin/bash -c 'GHCVER=$(sed -n "s/^ghc-version: \(.*\)/\1/p" constraints.yaml) && stack setup ghc-$GHCVER --verbosity=error && stack exec --resolver=ghc-$GHCVER stackage-curator check-snapshot && stackage-curator unpack'
116+docker run $ARGS_PREBUILD $IMAGE /bin/bash -c 'GHCVER=$(sed -n "s/^ghc-version: \(.*\)/\1/p" constraints.yaml) && stack setup ghc-$GHCVER --verbosity=error && stack exec --resolver=ghc-$GHCVER curator check-snapshot && curator unpack'
130
117
131case $SHORTNAME in
118case $SHORTNAME in
132 lts) JOBS=1 ;;
119 lts) JOBS=1 ;;
@@ -136,25 +123,24 @@ esac
136# Now do the actual build. We need to first set the owner of the home directory
123# Now do the actual build. We need to first set the owner of the home directory
137# correctly, so we run the command as root, change owner, and then use sudo to
124# correctly, so we run the command as root, change owner, and then use sudo to
138# switch back to the current user
125# switch back to the current user
139−docker run $ARGS_BUILD $IMAGE nice -n 15 /bin/bash -c "chown $USER $HOME && exec sudo -E -u $USER env \"HOME=$HOME\" \"PATH=\$PATH\" stackage-curator build --jobs $JOBS" 2>&1 | tee "$SHORTNAME-build.log"
126+docker run $ARGS_BUILD $IMAGE nice -n 15 /bin/bash -c "chown $USER $HOME && exec sudo -E -u $USER env \"HOME=$HOME\" \"PATH=\$PATH\" curator build --jobs $JOBS" 2>&1 | tee "$SHORTNAME-build.log"
140
127
141# Make sure we actually need this snapshot. We used to perform this check
128# Make sure we actually need this snapshot. We used to perform this check
142# exclusively before building. Now we perform it after as well for the case of
129# exclusively before building. Now we perform it after as well for the case of
143# nightly, where we don't perform this check beforehand. This is also slightly
130# nightly, where we don't perform this check beforehand. This is also slightly
144# safer, in case someone else already uploaded a specific snapshot while we
131# safer, in case someone else already uploaded a specific snapshot while we
145# were building.
132# were building.
146−docker run $ARGS_UPLOAD $IMAGE /bin/bash -c "exec stackage-curator check-target-available --target $TARGET"
133+docker run $ARGS_UPLOAD $IMAGE /bin/bash -c "exec curator check-target-available --target $TARGET"
147
134
148# Successful build, so we need to:
135# Successful build, so we need to:
149#
136#
150# * Upload the docs to S3
137# * Upload the docs to S3
151# * Upload the new snapshot .yaml file to the appropriate Github repo, also upload its constraints
138# * Upload the new snapshot .yaml file to the appropriate Github repo, also upload its constraints
152# * Register as a new Hackage distro (currently disabled)
139# * Register as a new Hackage distro (currently disabled)
153−docker run $ARGS_UPLOAD $IMAGE /bin/bash -c "stackage-curator upload-docs --target $TARGET && exec stackage-curator upload-github --target $TARGET"
140+docker run $ARGS_UPLOAD $IMAGE /bin/bash -c "curator upload-docs --target $TARGET && curator upload-github --target $TARGET && exec curator hackage-distro --target $TARGET"
154−# FIXME - add back "stackage-curator hackage-distro --target $TARGET" when we will be ready to publish
155# information about the new snapshots on Hackage
141# information about the new snapshots on Hackage
156
142
157−$BINDIR/stackage-curator legacy-bulk --stackage-snapshots dot-stackage/curator/stackage-snapshots/ --lts-haskell dot-stackage/curator/lts-haskell/ --stackage-nightly dot-stackage/curator/stackage-nightly/
143+$BINDIR/curator legacy-bulk --stackage-snapshots dot-stackage/curator/stackage-snapshots/ --lts-haskell dot-stackage/curator/lts-haskell/ --stackage-nightly dot-stackage/curator/stackage-nightly/
158
144
159(
145(
160
146
automated/new-stackage-format/convert.sh+3
@@ -21,7 +21,10 @@ do
21 fi
21 fi
22done
22done
23
23
24+(
25+export HOME=$(pwd)
24./convert
26./convert
27+)
25
28
26cd stackage-snapshots
29cd stackage-snapshots
27git add lts nightly
30git add lts nightly