1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
#!/bin/bash
# A single step in the build process.
# Executed once for each architecture (typically on different machines).
# Parameters are: <archlist> <version> <hash> <release-notes>
# Where:
# <archlist> is a list of build instructions. Separated by commas. See 'release-full' for specification.
# <version> is the current version
# <date> is the date of the release
# <hash> is the hash of the current Git-commit
# <release-notes> is a file containing the release notes (we might not have the latest tags)
archlist="$1"
version="$2"
date="$3"
hash="$4"
notes="$5"
export notes
# Tar the relevant files into one, so we can transmit it through ssh conveniently.
function tar_files {
cd $STORM_ROOT/release
if [[ -f $notes ]]
then
if [[ $notes != $STORM_ROOT/release/release_notes.txt ]]
then
cp $notes $STORM_ROOT/release/release_notes.txt
fi
else
release-notes > $STORM_ROOT/release/release_notes.txt
fi
shopt -s nullglob
tar cz release_notes.txt doc.tar.gz storm_*.{zip,tar.gz}
}
# Parse the archlist and do what it says.
while [[ $archlist != "" ]]
do
first="${archlist%%,*}"
if [[ $archlist == *,* ]]
then
archlist="${archlist#*,}"
else
archlist=""
fi
if [[ $first == done ]]
then
# Used only as a placeholder since we don't always handle empty parameters correctly.
exit 0
elif [[ $first == *@* ]]
then
echo "Continuing build at ${first}..."
tar_files | ssh "$first" '~/build-storm.sh' "$archlist" "$version" "$date" "$hash" || exit 1;
exit 0;
elif [[ $first == *:* ]]
then
archtag="${first%%:*}"
command="${first#*:}"
echo "----- Building ${archtag}... -----"
if [[ $archtag == *_win* ]]
then
packext="zip"
else
packext="tar.gz"
fi
release-compile "$archtag" "$command" "$version" || { echo "Compilation of $archtag failed."; exit 1; }
release-package "$archtag" "$command" "$version" "$date" "$notes" || { echo "Failed to package $archtag."; exit 1; }
release-test $STORM_ROOT/release/storm_$archtag.$packext || { echo "The packaged compiler ($archtag) does not seem to be working."; exit 1; }
else
echo "ERROR: Unknown build command: ${first}"
exit 1
fi
done
exit 0
|