AletaReleaser/build.sh

26 lines
534 B
Bash
Executable File

#!/bin/bash
source ~/.bashrc
cd $(dirname $0)
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
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
if [ ! -e output/aleta.tar.gz ]; then
echo "aleta.tar.gz not exists." 1>&2
exit 1
fi
perl create_aleta_release.pl