forked from MiLk/docker-php-xdebug
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpush.sh
executable file
·31 lines (23 loc) · 967 Bytes
/
push.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
28
29
30
#!/usr/bin/env bash
VERSIONS=$@
HIGHEST_MAJOR=0
HIGHEST_MINOR=0
for VERSION in $VERSIONS; do
# Determine newest patch version
ABS_VERSION=$(buildah images --format "{{.Tag}}" krouma/php-xdebug | grep $VERSION | sort -k1 -r | head -n1)
MAJOR_VERSION=$(echo $VERSION | cut -d "." -f1)
MINOR_VERSION=$(echo $VERSION | cut -d "." -f2)
# Push
buildah push krouma/php-xdebug:$VERSION
buildah push krouma/php-xdebug:$ABS_VERSION
if [ $MAJOR_VERSION -gt $HIGHEST_MAJOR ]; then
HIGHEST_MAJOR=$MAJOR_VERSION
HIGHEST_MINOR=$MINOR_VERSION
elif [ $MINOR_VERSION -gt $HIGHEST_MINOR ]; then
HIGHEST_MINOR=$MINOR_VERSION
fi
done
buildah tag krouma/php-xdebug:${HIGHEST_MAJOR}.${HIGHEST_MINOR} krouma/php-xdebug:${HIGHEST_MAJOR}
buildah tag krouma/php-xdebug:${HIGHEST_MAJOR}.${HIGHEST_MINOR} krouma/php-xdebug:latest
buildah push krouma/php-xdebug:${HIGHEST_MAJOR}
buildah push krouma/php-xdebug:latest