1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2024-11-20 10:18:21 +01:00
antd-web-apps/ci/scripts/antos.sh

33 lines
859 B
Bash
Raw Normal View History

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-06-26 00:21:11 +02:00
DEST="/opt/www/htdocs/os"
2020-06-26 10:31:46 +02:00
# /opt/www/htdocs
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"
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-06-26 10:31:46 +02:00
mkdir -p "$DEST"
2020-06-26 01:34:09 +02:00
BUILDDIR="$DEST" make release
echo "Done!"
2020-06-26 10:31:46 +02:00
} 2>&1 | tee "/opt/www/htdocs/ci/log/${PRJ}_${BRANCH}.txt"
2020-06-26 01:34:09 +02:00
2020-06-26 00:21:11 +02:00