2020-06-26 00:21:11 +02:00
|
|
|
#! /bin/bash
|
2020-06-26 01:34:09 +02:00
|
|
|
BRANCH="ci"
|
2020-06-26 10:31:46 +02:00
|
|
|
PRJ="antos"
|
2020-09-18 13:17:43 +02:00
|
|
|
DEST="/opt/www/htdocs/"
|
|
|
|
# /opt/www/htdocs
|
2020-06-26 10:31:46 +02:00
|
|
|
REPO="https://github.com/lxsang/$PRJ.git"
|
|
|
|
|
2020-06-26 00:21:11 +02:00
|
|
|
if [ ! -z $1 ]; then
|
|
|
|
BRANCH="$1"
|
|
|
|
fi
|
2020-06-26 01:34:09 +02:00
|
|
|
{
|
|
|
|
echo "Build date: $(date)"
|
2020-06-26 10:31:46 +02:00
|
|
|
echo "Building $PRJ using branch $BRANCH..."
|
|
|
|
if [ -d "/tmp/ci/$PRJ" ]; then
|
|
|
|
echo "Clean up /tmp/ci/$PRJ"
|
2020-09-18 13:17:43 +02:00
|
|
|
rm -rf /tmp/ci/$PRJ
|
2020-06-26 01:34:09 +02:00
|
|
|
else
|
2020-06-26 10:31:46 +02:00
|
|
|
echo "Creating /tmp/ci/"
|
2020-06-26 01:34:09 +02:00
|
|
|
mkdir -p "/tmp/ci"
|
|
|
|
fi
|
|
|
|
cd /tmp/ci || (echo "Unable to change directory to /tmp/ci" && exit 1)
|
2020-06-26 10:31:46 +02:00
|
|
|
echo "Cloning $PRJ (branch $BRANCH) to /tmp/ci..."
|
2020-06-26 01:34:09 +02:00
|
|
|
git clone -b "$BRANCH" --single-branch --depth=1 "$REPO"
|
2020-06-26 10:31:46 +02:00
|
|
|
cd "$PRJ" || (echo "Unable to change directory to source code folder" && exit 1)
|
2020-06-26 01:34:09 +02:00
|
|
|
npm i @types/jquery
|
2020-09-18 13:17:43 +02:00
|
|
|
mkdir -p "$DEST/os"
|
2020-09-18 13:36:20 +02:00
|
|
|
BUILDDIR="$DEST/os" make release
|
2020-09-18 13:17:43 +02:00
|
|
|
mkdir -p "$DEST/grs"
|
2020-09-18 13:36:20 +02:00
|
|
|
BUILDDIR="$DEST/grs" make standalone_tags
|
2020-06-26 01:34:09 +02:00
|
|
|
echo "Done!"
|
2020-06-26 10:31:46 +02:00
|
|
|
} 2>&1 | tee "/opt/www/htdocs/ci/log/${PRJ}_${BRANCH}.txt"
|