forked from laincloud/sso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
38 lines (29 loc) · 1.23 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
sudo: false
services:
- docker
- mysql
language: python
python:
- "2.7"
before_install:
- mysql -e 'CREATE DATABASE sso_test; CREATE USER test@"%" identified by "test"; grant all on sso_test.* to test@"%"; flush privileges;'
install:
- pip install lain-cli
script:
- lain config save-global private_docker_registry registry.lain.local
- lain build
- lain test
- LAIN_APPNAME=sso
- 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 --network=host --name sso $LAIN_APPNAME:build-$LAIN_IMAGE_VERSION bash -c "sh test.sh && bash <(curl -s https://codecov.io/bash)"
after_success:
- LAIN_APPNAME=sso
- 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