File tree 2 files changed +20
-6
lines changed
2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,14 @@ addons:
12
12
- cpio
13
13
env :
14
14
global :
15
- - VERSION=4.0.0-5
15
+ - MAJOR_VERSION=4
16
+ - MINOR_VERSION=0
17
+ - PATCH_VERSION=0
18
+ - RELEASE_VERSION=5
19
+ - VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION-$RELEASE_VERSION
20
+ # Container tag version string.
21
+ # Set it here to give a flexibility of the value such as "vX.Y".
22
+ - TAG_VER=v$VERSION
16
23
# See qemu-user-static's RPM spec file on Fedora to check the new version.
17
24
# https://src.fedoraproject.org/rpms/qemu/blob/master/f/qemu.spec
18
25
- DOCKER_SERVER=docker.io
@@ -33,7 +40,7 @@ script:
33
40
if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then
34
41
./publish.sh -v "$VERSION" -t "$GITHUB_TOKEN" -r "$REPO"
35
42
fi
36
- - ./update.sh -v "$VERSION" -r "$REPO" -d "$DOCKER_REPO"
43
+ - ./update.sh -v "$VERSION" -t "$TAG_VER" - r "$REPO" -d "$DOCKER_REPO"
37
44
- docker images
38
45
- ./test.sh -d "$DOCKER_REPO"
39
46
after_success :
Original file line number Diff line number Diff line change @@ -4,12 +4,14 @@ set -xe
4
4
# A POSIX variable
5
5
OPTIND=1 # Reset in case getopts has been used previously in the shell.
6
6
7
- while getopts " r:v:d:" opt; do
7
+ while getopts " r:v:t: d:" opt; do
8
8
case " $opt " in
9
9
r) REPO=$OPTARG
10
10
;;
11
11
v) VERSION=$OPTARG
12
12
;;
13
+ t) TAG_VER=$OPTARG
14
+ ;;
13
15
d) DOCKER_REPO=$OPTARG
14
16
;;
15
17
esac
@@ -58,11 +60,16 @@ for to_arch in $to_archs; do
58
60
FROM scratch
59
61
COPY qemu-${to_arch} -static /usr/bin/
60
62
EOF
61
- docker build -t ${DOCKER_REPO} :$from_arch -$to_arch ${work_dir}
62
- docker tag ${DOCKER_REPO} :$from_arch -$to_arch ${DOCKER_REPO} :$to_arch
63
+ docker build -t ${DOCKER_REPO} :$from_arch -$to_arch -${TAG_VER} ${work_dir}
64
+ for target in " ${DOCKER_REPO} :$from_arch -$to_arch " \
65
+ " ${DOCKER_REPO} :$to_arch -${TAG_VER} " \
66
+ " ${DOCKER_REPO} :$to_arch " ; do
67
+ docker tag ${DOCKER_REPO} :$from_arch -$to_arch -${TAG_VER} " ${target} "
68
+ done
63
69
rm -rf " ${work_dir} "
64
70
fi
65
71
done
66
72
67
- docker build -t ${DOCKER_REPO} :latest " ${out_dir} /latest"
73
+ docker build -t ${DOCKER_REPO} :${TAG_VER} " ${out_dir} /latest"
74
+ docker tag ${DOCKER_REPO} :${TAG_VER} ${DOCKER_REPO} :latest
68
75
docker build -t ${DOCKER_REPO} :register " ${out_dir} /register"
You can’t perform that action at this time.
0 commit comments