forked from MPIB/Lagerregal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
68 lines (65 loc) · 2.6 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
language: python
python:
- "3.6"
sudo: required
services:
- docker
jobs:
include:
- stage: build
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker build -t mpib/lagerregal:"$TRAVIS_COMMIT" .
- docker push mpib/lagerregal:"$TRAVIS_COMMIT"
- stage: flake8
script:
- docker run --rm -it mpib/lagerregal:"$TRAVIS_COMMIT" flake8 --config=setup.cfg
- stage: test
script:
- docker run --rm -it mpib/lagerregal:"$TRAVIS_COMMIT" ./manage.py test
# release a docker image every time develop or master gets changed
# there is no reason to keep an image for every branch just yet
- stage: release_master
if: branch = master AND type != pull_request
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker pull mpib/lagerregal:"$TRAVIS_COMMIT"
- docker tag mpib/lagerregal:"$TRAVIS_COMMIT" mpib/lagerregal:latest
- docker push mpib/lagerregal:latest
- stage: release_develop
if: branch = develop AND type != pull_request
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker pull mpib/lagerregal:"$TRAVIS_COMMIT"
- docker tag mpib/lagerregal:"$TRAVIS_COMMIT" mpib/lagerregal:develop
- docker push mpib/lagerregal:develop
# the demo tag will only be tested and published with master changes (aka a release)
- stage: build_demo
if: branch = master
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker build -t mpib/lagerregal:demo_"$TRAVIS_COMMIT" -f demo/Dockerfile .
- docker push mpib/lagerregal:demo_"$TRAVIS_COMMIT"
- stage: test_demo
if: branch = master
script:
- docker run --rm mpib/lagerregal:demo_"$TRAVIS_COMMIT" ./manage.py test
- stage: release_demo
if: branch = master AND type != pull_request
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker pull mpib/lagerregal:demo_"$TRAVIS_COMMIT"
- docker tag mpib/lagerregal:demo_"$TRAVIS_COMMIT" mpib/lagerregal:demo
- docker push mpib/lagerregal:demo
## command to install dependencies
#install:
# - "pip install -r dependencies.txt"
# - "pip install flake8"
# - npm install -g casperjs
# # create the database
# - "cp Lagerregal/template_development.py Lagerregal/settings.py"
# - "./manage.py migrate"
## command to run tests
#script:
# - flake8 --config=setup.cfg
# - "./manage.py test"