-
Notifications
You must be signed in to change notification settings - Fork 11
/
update.sh
executable file
·29 lines (22 loc) · 901 Bytes
/
update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
cd /etc/git/docker.xfce-vnc
echo $(cat VERSION | cut -d. -f1-2).$(( 1 + $(cat VERSION | cut -d. -f3 ))) > VERSION
REG=docker.io/christian773/xfce-vnc
REG_PATT=$(echo $REG | cut -d/ -f2-)
VERSION=$(cat VERSION)
RELEASE=latest
echo "--------------------------------------------------
INFO: Building Release: $RELEASE / VERSION: $VERSION
--------------------------------------------------
"
test -f Dockerfile || (echo "ERROR: Dockerfile not found" ; exit 1)
sed -i "s/^ENV REFRESHED_AT.*/ENV REFRESHED_AT $(date '+%Y-%m-%d-%H:%M')/" Dockerfile
sed -i "s/^ENV VERSION.*/ENV VERSION $VERSION/" Dockerfile
git add -A
git commit -a -m "automated build, RELEASE: $RELEASE"
docker system prune -a -f
docker build -t $REG:$VERSION .
docker tag $REG:$VERSION $REG:$RELEASE
docker push $REG:$RELEASE
docker push $REG:$VERSION