2021-12-11 00:44:01 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-12-16 15:01:17 +00:00
|
|
|
if [ ! -f spark.phar ]; then
|
|
|
|
echo "error: No spark.phar has been built yet?"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-12-17 11:51:29 +00:00
|
|
|
if [ -z "$VERSION" ]; then
|
|
|
|
VERSION="$(git describe --tags)"
|
2021-12-29 23:53:08 +00:00
|
|
|
if [ -z "$VERSION" ]; then
|
|
|
|
echo "Could not parse version from git. Export VERSION if you are building manually."
|
|
|
|
exit 1
|
|
|
|
fi
|
2021-12-17 11:51:29 +00:00
|
|
|
fi
|
2021-12-29 23:53:08 +00:00
|
|
|
echo "* Version: $VERSION"
|
|
|
|
if [ ! -z "$FLAVOR" ]; then
|
|
|
|
VERSION="${VERSION}-${FLAVOR}"
|
|
|
|
echo "* Flavor: $FLAVOR"
|
2021-12-11 00:44:01 +00:00
|
|
|
fi
|
|
|
|
|
2021-12-29 23:53:08 +00:00
|
|
|
PATH="$PWD/tools:$PATH"
|
|
|
|
|
2021-12-11 00:44:01 +00:00
|
|
|
if [ -z $DESTINATION ]; then
|
|
|
|
DESTINATION="release/$VERSION"
|
|
|
|
fi
|
|
|
|
echo " DESTINATION=$DESTINATION"
|
|
|
|
|
|
|
|
echo "* Preparing release direcory"
|
|
|
|
mkdir -p $DESTINATION
|
|
|
|
|
|
|
|
echo "* Copying files to release directory"
|
|
|
|
cp spark.phar $DESTINATION/spark.phar
|
|
|
|
cp README.md $DESTINATION/README.md
|
|
|
|
cp VERSIONS.md $DESTINATION/VERSIONS.md
|
|
|
|
|
|
|
|
echo "* Building dist and source archives"
|
|
|
|
7z a -tzip "$DESTINATION/spark-$VERSION-dist.zip" spark.phar plugins README.md VERSIONS.md >/dev/null
|
|
|
|
tar cfz "$DESTINATION/spark-$VERSION-dist.tgz" spark.phar plugins README.md VERSIONS.md
|
|
|
|
7z a -tzip "$DESTINATION/spark-$VERSION-src.zip" bin src runtime plugins composer.json README.md VERSIONS.md >/dev/null
|
|
|
|
tar cfz "$DESTINATION/spark-$VERSION-src.tgz" bin src runtime plugins composer.json README.md VERSIONS.md
|
|
|
|
|
|
|
|
echo "* Creating makeself installer"
|
|
|
|
test -d release/tmp && rm -rf release/tmp
|
|
|
|
mkdir release/tmp
|
|
|
|
cp -R spark.phar plugins README.md VERSIONS.md release/tmp/
|
|
|
|
pushd release/tmp &>/dev/null
|
|
|
|
makeself . ../../$DESTINATION/spark-$VERSION-dist.run "Spark $VERSION" ./spark.phar install &>/dev/null
|
|
|
|
popd &>/dev/null
|
|
|
|
rm -rf release/tmp
|
|
|
|
|
|
|
|
echo -e " ┌─[$DESTINATION]"
|
|
|
|
ls -hl --color=auto $DESTINATION | sed "s/^/ │ /"
|
|
|
|
|