Skip to content
This repository was archived by the owner on Nov 9, 2022. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

Commit b3c69a8

Browse files
committed
Fix develop image deployment
The $TRAVIS_TAG variable is available for tagged branches only. Separate tag deployments and branch deployments with their own docker tag commands.
1 parent 9e673ae commit b3c69a8

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

.travis.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ env:
1313
- IMAGE_NAME=storageos/cluster-operator
1414
- IMAGE_TAG=test
1515

16-
before_install:
17-
- |
18-
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md)|(\.MD)|(\.png)|(\.pdf)|^(doc/)|^(MAINTAINERS)|^(LICENSE)'; then
19-
# Do not skip if it's a tagged build.
20-
if [[ -z "$TRAVIS_TAG" ]]; then
21-
echo "Only doc files were updated, not running the CI."
22-
exit
23-
fi
24-
fi
16+
# before_install:
17+
# - |
18+
# if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md)|(\.MD)|(\.png)|(\.pdf)|^(doc/)|^(MAINTAINERS)|^(LICENSE)'; then
19+
# # Do not skip if it's a tagged build.
20+
# if [[ -z "$TRAVIS_TAG" ]]; then
21+
# echo "Only doc files were updated, not running the CI."
22+
# exit
23+
# fi
24+
# fi
2525
# - docker run -d -p 2399:2399 quay.io/coreos/etcd:v3.3.10 /usr/local/bin/etcd -advertise-client-urls http://0.0.0.0:2399 -listen-client-urls http://0.0.0.0:2399
2626

2727
# Skip downloading deps.
@@ -65,14 +65,12 @@ jobs:
6565
- make image/cluster-operator
6666
before_deploy:
6767
- docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASS"
68-
- docker tag "${IMAGE_NAME}:${IMAGE_TAG}" "${IMAGE_NAME}:latest"
69-
- docker tag "${IMAGE_NAME}:${IMAGE_TAG}" "${IMAGE_NAME}:${TRAVIS_TAG}"
7068
deploy:
7169
- provider: script
72-
script: docker push "${IMAGE_NAME}:latest" && docker push "${IMAGE_NAME}:${TRAVIS_TAG}"
70+
script: bash scripts/deploy.sh tagged
7371
on:
7472
tags: true
7573
- provider: script
76-
script: docker tag "${IMAGE_NAME}:${IMAGE_TAG}" "${IMAGE_NAME}:develop" && docker push "${IMAGE_NAME}:develop"
74+
script: bash scripts/deploy.sh develop
7775
on:
7876
branch: master

scripts/deploy.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
set -e
3+
4+
if [ "$1" = "tagged" ]; then
5+
docker tag "${IMAGE_NAME}:${IMAGE_TAG}" "${IMAGE_NAME}:latest"
6+
docker tag "${IMAGE_NAME}:${IMAGE_TAG}" "${IMAGE_NAME}:${TRAVIS_TAG}"
7+
docker push "${IMAGE_NAME}:latest" && docker push "${IMAGE_NAME}:${TRAVIS_TAG}"
8+
elif [ "$1" = "develop" ]; then
9+
docker tag "${IMAGE_NAME}:${IMAGE_TAG}" "${IMAGE_NAME}:develop"
10+
docker push "${IMAGE_NAME}:develop"
11+
fi

0 commit comments

Comments
 (0)