#!/bin/bash build() { cd aleta git fetch current_commit=$(git rev-parse HEAD) if [ $current_commit == `git rev-parse @{u}` ]; then echo 'Aleta is updated' cd - return 1 fi git pull cd - if [ -e output ]; then rm -rf output fi mkdir output docker build --no-cache -t aletareleaser:latest . --build-arg uid=$(getent passwd $(whoami) | awk -F: '{ print $3 }') docker run -v $(realpath output):/var/lib/aleta/output --rm aletareleaser } source ~/.bashrc cd $(dirname $0) if [ -f aleta.lock ]; then echo 'Deploy is running.'; exit 0; fi touch aleta.lock build exit_build=$? rm aleta.lock if [ $exit_build == 0 ]; then if [ ! -e output/aleta.tar.gz ]; then echo "aleta.tar.gz not exists." 1>&2 exit 1 fi perl create_aleta_release.pl fi