2019-07-19 10:07:43 +02:00
|
|
|
#!/bin/bash -x
|
|
|
|
|
2019-08-09 18:31:43 +02:00
|
|
|
DEFAULT=$(git branch|grep ^*|cut -c3-)
|
|
|
|
TAG=${1:-$DEFAULT}
|
2019-07-19 10:07:43 +02:00
|
|
|
VERSION=$TAG
|
2019-08-09 18:31:43 +02:00
|
|
|
BRANCH=$(echo $VERSION|sed 's/\.[0-9]\{8\}$//')
|
|
|
|
[ $VERSION = $BRANCH ] && VERSION="$BRANCH.x-dev"
|
2019-07-19 10:07:43 +02:00
|
|
|
|
2019-08-09 18:31:43 +02:00
|
|
|
[ $VERSION = "$DEFAULT.x-dev" ] && {
|
|
|
|
cd $(dirname $0)
|
2019-07-19 10:07:43 +02:00
|
|
|
grep self.version composer.json | while read pack version; do composer update $(echo $pack|cut -d'"' -f2); done
|
|
|
|
git status composer.lock|grep composer.lock && {
|
|
|
|
git stash; git pull --rebase; git stash pop
|
|
|
|
git commit -m 'updating composer.lock with latest commit hashed for egroupware/* packages' composer.lock
|
2019-08-09 18:31:43 +02:00
|
|
|
VERSION="$VERSION#$(git push|grep $DEFAULT|cut -c4-10)"
|
2019-07-19 10:07:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
cd $(dirname $0)
|
|
|
|
|
|
|
|
docker pull ubuntu:18.04
|
|
|
|
docker build --no-cache --build-arg "VERSION=$VERSION" -t egroupware/egroupware:$TAG . && {
|
|
|
|
docker push egroupware/egroupware:$TAG
|
|
|
|
# tag only stable releases as latest
|
2019-08-09 18:31:43 +02:00
|
|
|
[ $TAG != "master" ] && {
|
2019-07-19 10:07:43 +02:00
|
|
|
docker tag egroupware/egroupware:$TAG egroupware/egroupware:latest
|
|
|
|
docker push egroupware/egroupware:latest
|
|
|
|
}
|
2019-08-09 18:31:43 +02:00
|
|
|
[ "$BRANCH" != $VERSION -a "${BRANCH}.x-dev" != $VERSION ] && {
|
2019-07-19 10:07:43 +02:00
|
|
|
docker tag egroupware/egroupware:$VERSION egroupware/egroupware:$BRANCH
|
|
|
|
docker push egroupware/egroupware:$BRANCH
|
|
|
|
}
|
|
|
|
}
|