-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
44 lines (42 loc) · 1.5 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
dist: trusty
jobs:
include:
- stage: testing the build
sudo: false
language: python
services:
- docker
python:
- 3.6
- 3.7
- 3.8
env:
- TESTING_HOST=ws://localhost:8182
install:
- pip install pipenv
- pipenv install
- pipenv install --dev
script:
- pytest --cov=invana_engine tests/
before_script:
- docker pull janusgraph/janusgraph
- docker run --name janusgraph -it -d -p 8182:8182 janusgraph/janusgraph
- docker ps -a
- docker logs janusgraph
- until [ `docker logs janusgraph| wc -l` -gt 50 ]; do echo "gremlin not started yet"; sleep 5; echo `docker logs janusgraph | wc -l`; done
- sleep 30
- docker logs janusgraph
after_success:
- codecov
- stage: build and push docker image
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker build -t invanalabs/invana-engine .
- if [ -z "$TRAVIS_TAG" ]; then DOCKER_TAG=sha-`echo "$TRAVIS_COMMIT" | cut -c1-7`; else DOCKER_TAG=$TRAVIS_TAG; fi
- docker tag invanalabs/invana-engine invanalabs/invana-engine:"$DOCKER_TAG"
- docker tag invanalabs/invana-engine invanalabs/invana-engine:latest
- docker push invanalabs/invana-engine:"$DOCKER_TAG"
- docker push invanalabs/invana-engine:latest
stages:
- name: build and push docker image
if: tag IS present AND type != pull_request