@@ -28,6 +28,9 @@ before_install:
28
28
- ' echo " \"experimental\": \"enabled\"" >> $HOME/.docker/config.json'
29
29
- ' echo "}" >> $HOME/.docker/config.json'
30
30
- sudo service docker restart
31
+ # To have `DOCKER_USER` and `DOCKER_PASS`
32
+ # use `travis env set`.
33
+ - echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin
31
34
32
35
install :
33
36
# For cross buidling our images
@@ -55,9 +58,11 @@ before_script:
55
58
- if [ -n "$TRAVIS_TAG" ]; then
56
59
VERSION=$(echo "${TRAVIS_TAG}" | sed -e 's/\(.*\)[-v]\(.*\)/\1\2/g');
57
60
fi
58
- - if [ "${TRAVIS_BRANCH}" == 'stable ' ]; then
61
+ - if [ "${TRAVIS_BRANCH}" == 'master ' ]; then
59
62
VERSION="stable";
60
63
fi
64
+ # replace / with - in version
65
+ - VERSION=$(echo "${VERSION}" | sed 's|/|-|g');
61
66
62
67
script :
63
68
- make build-nocache NAME=${NAME} VERSION=${VERSION}-${TARGET_ARCH}
@@ -72,9 +77,6 @@ before_deploy:
72
77
- docker run -d --name test_image ${NAME}:${VERSION}-${TARGET_ARCH} sleep 10
73
78
- sleep 5
74
79
- sudo docker ps | grep -q test_image
75
- # To have `DOCKER_USER` and `DOCKER_PASS`
76
- # use `travis env set`.
77
- - docker login -u "$DOCKER_USER" -p "$DOCKER_PASS";
78
80
- make tag NAME=${NAME} VERSION=${VERSION}-${TARGET_ARCH}
79
81
80
82
deploy :
@@ -89,21 +91,21 @@ jobs:
89
91
install : skip
90
92
script : skip
91
93
after_deploy :
92
- - docker login -u "$DOCKER_USER" -p "$DOCKER_PASS";
94
+ - echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin
93
95
- docker manifest create ${NAME}:${VERSION} ${NAME}:${VERSION}-amd64 ${NAME}:${VERSION}-arm32v7 ${NAME}:${VERSION}-arm64v8;
94
96
docker manifest annotate ${NAME}:${VERSION} ${NAME}:${VERSION}-amd64 --os linux --arch amd64;
95
97
docker manifest annotate ${NAME}:${VERSION} ${NAME}:${VERSION}-arm32v7 --os linux --arch arm --variant v7;
96
98
docker manifest annotate ${NAME}:${VERSION} ${NAME}:${VERSION}-arm64v8 --os linux --arch arm64 --variant v8;
97
99
98
- # The latest tag is coming from the stable branch of the repo
99
- - if [ "${TRAVIS_BRANCH}" == 'stable ' ]; then
100
+ # The latest tag is coming from the master branch of the repo
101
+ - if [ "${TRAVIS_BRANCH}" == 'master ' ]; then
100
102
docker manifest create ${NAME}:latest ${NAME}:${VERSION}-amd64 ${NAME}:${VERSION}-arm32v7 ${NAME}:${VERSION}-arm64v8;
101
103
docker manifest annotate ${NAME}:latest ${NAME}:${VERSION}-amd64 --os linux --arch amd64;
102
104
docker manifest annotate ${NAME}:latest ${NAME}:${VERSION}-arm32v7 --os linux --arch arm --variant v7;
103
105
docker manifest annotate ${NAME}:latest ${NAME}:${VERSION}-arm64v8 --os linux --arch arm64 --variant v8;
104
106
fi
105
107
106
108
- docker manifest push ${NAME}:${VERSION};
107
- if [ "${TRAVIS_BRANCH}" == 'stable ' ]; then
109
+ if [ "${TRAVIS_BRANCH}" == 'master ' ]; then
108
110
docker manifest push ${NAME}:latest;
109
111
fi
0 commit comments