File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,12 @@ 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
+ - TAG_VER=v$MAJOR_VERSION.$MINOR_VERSION
16
21
# See qemu-user-static's RPM spec file on Fedora to check the new version.
17
22
# https://src.fedoraproject.org/rpms/qemu/blob/master/f/qemu.spec
18
23
- DOCKER_SERVER=docker.io
@@ -33,7 +38,7 @@ script:
33
38
if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then
34
39
./publish.sh -v "$VERSION" -t "$GITHUB_TOKEN" -r "$REPO"
35
40
fi
36
- - ./update.sh -v "$VERSION" -r "$REPO" -d "$DOCKER_REPO"
41
+ - ./update.sh -v "$VERSION" -t "$TAG_VER" - r "$REPO" -d "$DOCKER_REPO"
37
42
- docker images
38
43
- ./test.sh -d "$DOCKER_REPO"
39
44
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,15 @@ 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}
63
+ docker build -t ${DOCKER_REPO} :$from_arch -$to_arch -${TAG_VER} ${work_dir}
64
+ docker tag ${DOCKER_REPO} :$from_arch -$to_arch -${TAG_VER} ${DOCKER_REPO} :$from_arch -$to_arch
65
+ docker tag ${DOCKER_REPO} :$from_arch -$to_arch -${TAG_VER} ${DOCKER_REPO} :$to_arch -${TAG_VER}
62
66
docker tag ${DOCKER_REPO} :$from_arch -$to_arch ${DOCKER_REPO} :$to_arch
63
67
rm -rf " ${work_dir} "
64
68
fi
65
69
done
66
70
67
- docker build -t ${DOCKER_REPO} :latest " ${out_dir} /latest"
68
- docker build -t ${DOCKER_REPO} :register " ${out_dir} /register"
71
+ docker build -t ${DOCKER_REPO} :${TAG_VER} " ${out_dir} /latest"
72
+ docker tag ${DOCKER_REPO} :${TAG_VER} ${DOCKER_REPO} :latest
73
+ docker build -t ${DOCKER_REPO} :register-${TAG_VER} " ${out_dir} /register"
74
+ docker tag ${DOCKER_REPO} :register-${TAG_VER} ${DOCKER_REPO} :register
You can’t perform that action at this time.
0 commit comments