-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
37 lines (34 loc) · 954 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
30
31
32
33
34
35
36
dist: bionic
addons:
apt:
source:
- docker-bionic
packages:
- docker
services:
- docker
env:
global:
- PROJECT: tokend
- IMAGE_NAME: github.com/dl-only-tokens/back-listener
script:
- export IMAGE_TAG=$(test -z $TRAVIS_TAG && echo $TRAVIS_COMMIT || echo $TRAVIS_TAG)
- docker build -t $PROJECT/$IMAGE_NAME:$IMAGE_TAG .
before_deploy:
- echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
- echo "$GITLABREG_PASSWORD" | docker login -u "$GITLABREG_USERNAME" --password-stdin
registry.gitlab.com
- docker tag $PROJECT/$IMAGE_NAME:$IMAGE_TAG registry.gitlab.com/$PROJECT/docker-registry/$IMAGE_NAME:$IMAGE_TAG
deploy:
- provider: script
script:
- docker push $PROJECT/$IMAGE_NAME:$IMAGE_TAG
on:
all_branches: true
tags: true
- provider: script
script:
- docker push registry.gitlab.com/$PROJECT/docker-registry/$IMAGE_NAME:$IMAGE_TAG
on:
all_branches: true
tags: false