Skip to content

Commit 55e6523

Browse files
committed
Publish each master build to docker hub
1 parent 8c0eb4d commit 55e6523

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.travis.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ script:
88

99
deploy:
1010
- provider: script
11-
script: tools/cd.sh
11+
script: tools/cd.sh travis-${TRAVIS_BUILD_NUMBER}
12+
on:
13+
branch: master
14+
15+
- provider: script
16+
script: tools/cd.sh release-${TRAVIS_TAG}
1217
on:
13-
repo: chakki-works/doccano
1418
tags: true

tools/cd.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
if [[ -z "${DOCKER_USERNAME}" ]]; then echo "Missing DOCKER_USERNAME environment variable" >&2; exit 1; fi
44
if [[ -z "${DOCKER_PASSWORD}" ]]; then echo "Missing DOCKER_PASSWORD environment variable" >&2; exit 1; fi
5-
if [[ -z "${TRAVIS_TAG}" ]]; then echo "Missing TRAVIS_TAG environment variable" >&2; exit 1; fi
5+
if [[ -z "$1" ]]; then echo "Usage: $0 <tag>" >&2; exit 1; fi
66

77
set -o errexit
88

99
docker build -t "${DOCKER_USERNAME}/doccano:latest" .
10-
docker build -t "${DOCKER_USERNAME}/doccano:${TRAVIS_TAG}" .
10+
docker build -t "${DOCKER_USERNAME}/doccano:$1" .
1111

1212
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
1313

1414
docker push "${DOCKER_USERNAME}/doccano:latest"
15-
docker push "${DOCKER_USERNAME}/doccano:${TRAVIS_TAG}"
15+
docker push "${DOCKER_USERNAME}/doccano:$1"

0 commit comments

Comments
 (0)