@@ -28,6 +28,9 @@ before_install:
2828 - ' echo " \"experimental\": \"enabled\"" >> $HOME/.docker/config.json'
2929 - ' echo "}" >> $HOME/.docker/config.json'
3030 - 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
3134
3235install :
3336 # For cross buidling our images
@@ -51,9 +54,11 @@ before_script:
5154 - if [ -n "$TRAVIS_TAG" ]; then
5255 VERSION=$(echo "${TRAVIS_TAG}" | sed -e 's/\(.*\)[-v]\(.*\)/\1\2/g');
5356 fi
54- - if [ "${TRAVIS_BRANCH}" == 'stable ' ]; then
57+ - if [ "${TRAVIS_BRANCH}" == 'master ' ]; then
5558 VERSION="stable";
5659 fi
60+ # replace / with - in version
61+ - VERSION=$(echo "${VERSION}" | sed 's|/|-|g');
5762
5863script :
5964 - make build-nocache NAME=${NAME} VERSION=${VERSION}-${TARGET_ARCH}
@@ -64,9 +69,6 @@ before_deploy:
6469 - docker run -d --name test_image ${NAME}:${VERSION}-${TARGET_ARCH} sleep 10
6570 - sleep 5
6671 - sudo docker ps | grep -q test_image
67- # To have `DOCKER_USER` and `DOCKER_PASS`
68- # use `travis env set`.
69- - docker login -u "$DOCKER_USER" -p "$DOCKER_PASS";
7072 - make tag NAME=${NAME} VERSION=${VERSION}-${TARGET_ARCH}
7173
7274deploy :
@@ -81,21 +83,21 @@ jobs:
8183 install : skip
8284 script : skip
8385 after_deploy :
84- - docker login -u "$DOCKER_USER" -p "$DOCKER_PASS";
86+ - echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin
8587 - docker manifest create ${NAME}:${VERSION} ${NAME}:${VERSION}-amd64 ${NAME}:${VERSION}-arm32v7 ${NAME}:${VERSION}-arm64v8;
8688 docker manifest annotate ${NAME}:${VERSION} ${NAME}:${VERSION}-amd64 --os linux --arch amd64;
8789 docker manifest annotate ${NAME}:${VERSION} ${NAME}:${VERSION}-arm32v7 --os linux --arch arm --variant v7;
8890 docker manifest annotate ${NAME}:${VERSION} ${NAME}:${VERSION}-arm64v8 --os linux --arch arm64 --variant v8;
8991
90- # The latest tag is coming from the stable branch of the repo
91- - if [ "${TRAVIS_BRANCH}" == 'stable ' ]; then
92+ # The latest tag is coming from the master branch of the repo
93+ - if [ "${TRAVIS_BRANCH}" == 'master ' ]; then
9294 docker manifest create ${NAME}:latest ${NAME}:${VERSION}-amd64 ${NAME}:${VERSION}-arm32v7 ${NAME}:${VERSION}-arm64v8;
9395 docker manifest annotate ${NAME}:latest ${NAME}:${VERSION}-amd64 --os linux --arch amd64;
9496 docker manifest annotate ${NAME}:latest ${NAME}:${VERSION}-arm32v7 --os linux --arch arm --variant v7;
9597 docker manifest annotate ${NAME}:latest ${NAME}:${VERSION}-arm64v8 --os linux --arch arm64 --variant v8;
9698 fi
9799
98100 - docker manifest push ${NAME}:${VERSION};
99- if [ "${TRAVIS_BRANCH}" == 'stable ' ]; then
101+ if [ "${TRAVIS_BRANCH}" == 'master ' ]; then
100102 docker manifest push ${NAME}:latest;
101103 fi
0 commit comments