Changeset View
Changeset View
Standalone View
Standalone View
build.sh
Show All 17 Lines | |||||
SNAPDIR=${WORKDIR}/snap | SNAPDIR=${WORKDIR}/snap | ||||
TMPDIR=${WORKDIR}/tmp | TMPDIR=${WORKDIR}/tmp | ||||
SIGDIR=${WORKDIR}/sigs | SIGDIR=${WORKDIR}/sigs | ||||
mkdir ${WORKDIR} ${SNAPDIR} ${TMPDIR} ${SIGDIR} | mkdir ${WORKDIR} ${SNAPDIR} ${TMPDIR} ${SIGDIR} | ||||
# Record when we're starting | # Record when we're starting | ||||
SNAPDATE=`date "+%s"` | SNAPDATE=`date "+%s"` | ||||
# Get the latest revision # on the tree | # Update and get the latest commit hash | ||||
if ! NEWREV=`sh -e s/svn-getrev.sh head`; then | git --git-dir=${STATEDIR}/gitrepo fetch | ||||
emaste: Perhaps should set `REPODIR=${STATEDIR}/gitrepo` in build.conf and use it throughout. | |||||
echo "Waiting 5 minutes for svn server to return" | NEWHASH=`git --git-dir=${STATEDIR}/gitrepo rev-parse HEAD` | ||||
sleep 300 | |||||
NEWREV=`sh -e s/svn-getrev.sh head` | |||||
fi | |||||
# Create a memory disk for holding the snapshot files. | # Create a memory disk for holding the snapshot files. | ||||
SNAPMD=`mdconfig -a -t swap -s ${SNAPMDSIZE} -n` | SNAPMD=`mdconfig -a -t swap -s ${SNAPMDSIZE} -n` | ||||
newfs -O 1 -n /dev/md${SNAPMD} >/dev/null | newfs -O 1 -n /dev/md${SNAPMD} >/dev/null | ||||
mount -o noatime,noexec,async /dev/md${SNAPMD} ${SNAPDIR} | mount -o noatime,noexec,async /dev/md${SNAPMD} ${SNAPDIR} | ||||
# Build a snapshot | # Build a snapshot | ||||
sh -e s/treesnap-build.sh head@${NEWREV} "${DESCRIBES_BUILD}" \ | sh -e s/treesnap-build.sh ${NEWHASH} "${DESCRIBES_BUILD}" \ | ||||
${TMPDIR} ${SNAPDIR} | ${TMPDIR} ${SNAPDIR} | ||||
# Replace tarballs with "aliased" tarballs | # Replace tarballs with "aliased" tarballs | ||||
if ! [ -z ${ALIASFILE} ]; then | if ! [ -z ${ALIASFILE} ]; then | ||||
if [ ${MODE} = "snap" ]; then | if [ ${MODE} = "snap" ]; then | ||||
sh -e s/alias-all.sh ${SNAPDIR} ${STATEDIR}/fileset/oldfiles \ | sh -e s/alias-all.sh ${SNAPDIR} ${STATEDIR}/fileset/oldfiles \ | ||||
${ALIASFILE} ${WORKDIR} | ${ALIASFILE} ${WORKDIR} | ||||
else | else | ||||
sh -e s/alias-index.sh ${SNAPDIR} ${STATEDIR}/fileset/oldfiles \ | sh -e s/alias-index.sh ${SNAPDIR} ${STATEDIR}/fileset/oldfiles \ | ||||
${ALIASFILE} ${WORKDIR} | ${ALIASFILE} ${WORKDIR} | ||||
fi | fi | ||||
fi | fi | ||||
# Send emails if INDEX was broken or fixed | # Send emails if INDEX was broken or fixed | ||||
sh -e s/describes-warn.sh ${SNAPDIR} ${NEWREV} ${STATEDIR}/describes \ | sh -e s/describes-warn.sh ${SNAPDIR} ${NEWHASH} ${STATEDIR}/describes \ | ||||
"${DESCRIBES_BUILD}" | "${DESCRIBES_BUILD}" | ||||
# Use old DESCRIBE files if the latest ones didn't build | # Use old DESCRIBE files if the latest ones didn't build | ||||
sh -e s/describes-fallback.sh ${SNAPDIR} ${STATEDIR}/describes \ | sh -e s/describes-fallback.sh ${SNAPDIR} ${STATEDIR}/describes \ | ||||
"${DESCRIBES_PUBLISH}" | "${DESCRIBES_PUBLISH}" | ||||
# Collect metadata | # Collect metadata | ||||
sh -e s/treesnap-index.sh ${SNAPDIR} ${WORKDIR}/INDEX ${WORKDIR}/tINDEX | sh -e s/treesnap-index.sh ${SNAPDIR} ${WORKDIR}/INDEX ${WORKDIR}/tINDEX | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |
Perhaps should set REPODIR=${STATEDIR}/gitrepo in build.conf and use it throughout.