-
Notifications
You must be signed in to change notification settings - Fork 15
/
.travis.yml
33 lines (26 loc) · 1.25 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
sudo: false
services:
- docker
language: python
python:
- "2.7"
install:
- pip install lain-cli
script:
- lain config save-global private_docker_registry registry.lain.local
- lain build
- lain test
- LAIN_APPNAME=console
- LAIN_IMAGE_VERSION="$(git show -s --format=%ct $TRAVIS_COMMIT)-$TRAVIS_COMMIT"
- ci_env=`bash <(curl -s https://codecov.io/env)`
- docker run $ci_env --name console-build $LAIN_APPNAME:build-$LAIN_IMAGE_VERSION bash -c 'rm -rf * && git clone https://github.com/laincloud/console && cd console && pip install codecov && pip install -r pip-req.txt && mkdir -p /lain/logs && CONSOLE_DEBUG=1 py.test --cov=./ && bash <(curl -s https://codecov.io/bash) && codecov'
after_success:
- LAIN_APPNAME=console
- LAIN_IMAGE_VERSION="$(git show -s --format=%ct $TRAVIS_COMMIT)-$TRAVIS_COMMIT"
- if [ "$TRAVIS_TAG" != "" ]; then
docker login -u="$DOCKER_USER" -p="$DOCKER_PASS";
docker tag $LAIN_APPNAME:release-$LAIN_IMAGE_VERSION laincloud/$LAIN_APPNAME:release-$LAIN_IMAGE_VERSION;
docker tag $LAIN_APPNAME:meta-$LAIN_IMAGE_VERSION laincloud/$LAIN_APPNAME:meta-$LAIN_IMAGE_VERSION;
docker push laincloud/$LAIN_APPNAME:release-$LAIN_IMAGE_VERSION;
docker push laincloud/$LAIN_APPNAME:meta-$LAIN_IMAGE_VERSION;
fi