-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
23 lines (21 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
language: python
sudo: required
services:
- docker
os:
- linux
install:
- docker pull carinerey/caars_env
before_script:
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, BRANCH=$BRANCH"
- if [[ $BRANCH == "master" ]]; then DOCKER_caars="caars"; DOCKER_tuto="caars_tuto"; else DOCKER_caars="caars_dev"; DOCKER_tuto="caars_tuto_dev"; fi
- docker build --build-arg BRANCH_DEV=$BRANCH -t carinerey/$DOCKER_caars etc/$DOCKER_caars/ && echo """cd /opt/caars && make test""" > test.sh && docker run -v $PWD:$PWD -t carinerey/$DOCKER_caars bash $PWD/test.sh
script:
- git clone https://github.com/CarineRey/caars.wiki.git caars_wiki_git && docker build -t carinerey/$DOCKER_tuto caars_wiki_git/etc/$DOCKER_tuto && travis_wait 40 docker run -e LOCAL_USER_ID=`id -u $USER` -e SHARED_DIR=$PWD -e TUTO_DIR=$PWD/caars_wiki_git/scripts/ -v $PWD:$PWD -t carinerey/$DOCKER_tuto $PWD/caars_wiki_git/scripts/test_tuto.sh
after_success:
- docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- export REPO_caars=$DOCKER_USER/$DOCKER_caars
- export REPO_tuto=$DOCKER_USER/$DOCKER_tuto
- docker push $REPO_caars
- docker push $REPO_tuto