-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
29 lines (27 loc) · 870 Bytes
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
services:
- docker
env:
global:
- IMAGE_COMMIT_NAME=x007007007/easy-climb-wall:${TRAVIS_COMMIT}
- IMAGE_LATEST_NAME=x007007007/easy-climb-wall:latest
- IMAGE_TAG_NAME=x007007007/easy-climb-wall:${TRAVIS_TAG}
- VERSION=${TRAVIS_TAG#v}
before_install:
- echo "`date` - travis CI build"
- echo ${IMAGE_COMMIT_NAME}
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker build --build-arg=VERSION=${VERSION} -t ${IMAGE_COMMIT_NAME} .
- docker push ${IMAGE_COMMIT_NAME}
deploy:
- provider: script
script:
- docker tag ${IMAGE_COMMIT_NAME} {IMAGE_LATEST_NAME} || true
- docker push {IMAGE_LATEST_NAME}
on:
branch: master
- provider: script
script:
- docker tag ${IMAGE_COMMIT_NAME} {$IMAGE_TAG_NAME} || true
- docker push {$IMAGE_TAG_NAME}
on:
tags: true