forked from invana/invana-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
50 lines (49 loc) · 1.91 KB
/
.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
dist: trusty
jobs:
include:
- stage: testing the build
script:
- if [ -z "$TRAVIS_TAG" ]; then DOCKER_TAG=sha-`echo "$TRAVIS_COMMIT" | cut -c1-7`; else DOCKER_TAG=$TRAVIS_TAG; fi
- echo "Docker tag would be $DOCKER_TAG"
- docker build -t invanalabs/graph-explorer .
- stage: build and push docker image
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker build -t invanalabs/graph-explorer .
- if [ -z "$TRAVIS_TAG" ]; then DOCKER_TAG=sha-`echo "$TRAVIS_COMMIT" | cut -c1-7`; else DOCKER_TAG=$TRAVIS_TAG; fi
- docker tag invanalabs/graph-explorer invanalabs/graph-explorer:"$DOCKER_TAG"
- docker tag invanalabs/graph-explorer invanalabs/graph-explorer:latest
- docker push invanalabs/graph-explorer:"$DOCKER_TAG"
- docker push invanalabs/graph-explorer:latest
- stage: deploy to heroku edge version
script: skip
deploy: &heroku
provider: heroku
app: graph-explorer-edge
api_key: $HEROKU_AUTH_TOKEN
on:
all_branches: true
- stage: deploy to heroku
script: skip
deploy: &heroku
provider: heroku
app: graph-explorer
api_key: $HEROKU_AUTH_TOKEN
on:
tags: true
all_branches: true
- stage: test edge deployemnt
script: 'curl http://graph-explorer-edge.herokuapp.com'
- stage: test prod deployemnt
script: 'curl http://graph-explorer.herokuapp.com'
stages:
- name: deploy to heroku edge version
if: branch = develop AND type != pull_request
- name: test edge deployemnt
if: branch = develop AND type != pull_request
- name: deploy to heroku
if: tag IS present AND type != pull_request
- name: test prod deployemnt
if: tag IS present AND type != pull_request
- name: build and push docker image
if: tag IS present AND type != pull_request