2022-02-08 21:21:23 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source ~/.bashrc
|
2022-02-08 05:42:26 +01:00
|
|
|
cd $(dirname $0)
|
2022-02-08 21:26:24 +01:00
|
|
|
if [ -f aleta.lock ]; then
|
|
|
|
echo 'Deploy is running.';
|
|
|
|
fi
|
|
|
|
touch aleta.lock
|
2022-02-08 20:50:21 +01:00
|
|
|
pushd aleta
|
|
|
|
git fetch
|
|
|
|
current_commit=$(git rev-parse HEAD)
|
|
|
|
if [ $current_commit == `git rev-parse @{u}` ]; then
|
|
|
|
echo 'Aleta is updated'
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
git pull
|
|
|
|
popd
|
2022-02-08 05:42:26 +01:00
|
|
|
if [ -e output ]; then
|
|
|
|
rm -rf output
|
|
|
|
fi
|
|
|
|
mkdir output
|
|
|
|
sudo docker build --no-cache -t aletareleaser:latest .
|
|
|
|
sudo docker run -v $(realpath output):/var/lib/aleta/output --rm -it aletareleaser
|
2022-02-08 20:50:21 +01:00
|
|
|
if [ ! -e output/aleta.tar.gz ]; then
|
|
|
|
echo "aleta.tar.gz not exists." 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
2022-02-08 21:26:24 +01:00
|
|
|
rm aleta.lock
|
2022-02-08 20:50:21 +01:00
|
|
|
perl create_aleta_release.pl
|