ci: git flow

This commit is contained in:
Bertrand Gouny
2021-02-19 13:58:19 +01:00
parent 32eb22ce1e
commit 37ec78df71
+10 -8
View File
@@ -28,6 +28,9 @@ before_install:
- 'echo " \"experimental\": \"enabled\"" >> $HOME/.docker/config.json'
- 'echo "}" >> $HOME/.docker/config.json'
- sudo service docker restart
# To have `DOCKER_USER` and `DOCKER_PASS`
# use `travis env set`.
- echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin
install:
# For cross buidling our images
@@ -55,9 +58,11 @@ before_script:
- if [ -n "$TRAVIS_TAG" ]; then
VERSION=$(echo "${TRAVIS_TAG}" | sed -e 's/\(.*\)[-v]\(.*\)/\1\2/g');
fi
- if [ "${TRAVIS_BRANCH}" == 'stable' ]; then
- if [ "${TRAVIS_BRANCH}" == 'master' ]; then
VERSION="stable";
fi
# replace / with - in version
- VERSION=$(echo "${VERSION}" | sed 's|/|-|g');
script:
- make build-nocache NAME=${NAME} VERSION=${VERSION}-${TARGET_ARCH}
@@ -72,9 +77,6 @@ before_deploy:
- docker run -d --name test_image ${NAME}:${VERSION}-${TARGET_ARCH} sleep 10
- sleep 5
- sudo docker ps | grep -q test_image
# To have `DOCKER_USER` and `DOCKER_PASS`
# use `travis env set`.
- docker login -u "$DOCKER_USER" -p "$DOCKER_PASS";
- make tag NAME=${NAME} VERSION=${VERSION}-${TARGET_ARCH}
deploy:
@@ -89,14 +91,14 @@ jobs:
install: skip
script: skip
after_deploy:
- docker login -u "$DOCKER_USER" -p "$DOCKER_PASS";
- echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin
- docker manifest create ${NAME}:${VERSION} ${NAME}:${VERSION}-amd64 ${NAME}:${VERSION}-arm32v7 ${NAME}:${VERSION}-arm64v8;
docker manifest annotate ${NAME}:${VERSION} ${NAME}:${VERSION}-amd64 --os linux --arch amd64;
docker manifest annotate ${NAME}:${VERSION} ${NAME}:${VERSION}-arm32v7 --os linux --arch arm --variant v7;
docker manifest annotate ${NAME}:${VERSION} ${NAME}:${VERSION}-arm64v8 --os linux --arch arm64 --variant v8;
# The latest tag is coming from the stable branch of the repo
- if [ "${TRAVIS_BRANCH}" == 'stable' ]; then
# The latest tag is coming from the master branch of the repo
- if [ "${TRAVIS_BRANCH}" == 'master' ]; then
docker manifest create ${NAME}:latest ${NAME}:${VERSION}-amd64 ${NAME}:${VERSION}-arm32v7 ${NAME}:${VERSION}-arm64v8;
docker manifest annotate ${NAME}:latest ${NAME}:${VERSION}-amd64 --os linux --arch amd64;
docker manifest annotate ${NAME}:latest ${NAME}:${VERSION}-arm32v7 --os linux --arch arm --variant v7;
@@ -104,6 +106,6 @@ jobs:
fi
- docker manifest push ${NAME}:${VERSION};
if [ "${TRAVIS_BRANCH}" == 'stable' ]; then
if [ "${TRAVIS_BRANCH}" == 'master' ]; then
docker manifest push ${NAME}:latest;
fi