-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
66 lines (60 loc) · 2.55 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
language: python
python:
- 3.6
services:
- docker
before_install:
- export PYTHONPATH=$HOME/builds/jay-johnson/antinex-core
- export PIP_USE_MIRRORS=true
- export USE_VERSION=$(cat setup.py | grep " version=" | sed -e 's/"/ /g' | awk '{print $2}')
- export REPO=jayjohnson/ai-core
- export REPO_CORE=jayjohnson/antinex-core
- export REPO_JUPYTER=jayjohnson/antinex-jupyter
- echo "Building Docker with tag=${USE_VERSION}"
- echo ""
- echo "Testing Docker Hub credentials username=${DOCKER_USERNAME}"
- docker login --username $DOCKER_USERNAME --password $DOCKER_PASSWORD
- echo "Docker Hub credentials are working"
install:
- pip install -e .
script:
# - echo "Running Lint Tests"
# - flake8
# - pycodestyle --exclude=.tox,.eggs
- echo "Running Unit Tests"
- python setup.py test
after_success:
- export USE_VERSION=$(cat setup.py | grep " version=" | sed -e 's/"/ /g' | awk '{print $2}')
- echo "Test Success - Branch=${TRAVIS_BRANCH} Version=${USE_VERSION} Pull Request=${TRAVIS_PULL_REQUEST} Tag=${TRAVIS_TAG}"
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then echo -e "Push Container to Docker Hub"; fi
- echo "Logging into Docker Hub"
- docker login --username $DOCKER_USERNAME --password $DOCKER_PASSWORD
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
- echo "starting: cd docker && docker build -f Dockerfile -t ${REPO} ."
- cd docker && docker build -f Dockerfile -t $REPO .
- echo "docker tag ${REPO} ${REPO}:${USE_VERSION}"
- docker tag $REPO $REPO:$USE_VERSION
- echo "docker push ${REPO}"
- docker push $REPO
- echo "docker push ${REPO}:${USE_VERSION}"
- docker push $REPO:$USE_VERSION
- echo ""
- echo "Building Core container"
- echo "docker tag ${REPO_CORE} ${REPO_CORE}:latest"
- docker tag $REPO $REPO_CORE:latest
- echo "docker tag ${REPO_CORE} ${REPO_CORE}:${USE_VERSION}"
- docker tag $REPO $REPO_CORE:$USE_VERSION
- echo "docker push ${REPO_CORE}"
- docker push $REPO_CORE
- echo "docker push ${REPO_CORE}:${USE_VERSION}"
- docker push $REPO_CORE:$USE_VERSION
- echo ""
- echo "Building Jupyter container"
- echo "starting: cd jupyter && docker build -f Dockerfile -t ${REPO_JUPYTER} ."
- cd jupyter && docker build -f Dockerfile -t $REPO_JUPYTER .
- echo "docker tag ${REPO_JUPYTER} ${REPO_JUPYTER}:${USE_VERSION}"
- docker tag $REPO_JUPYTER $REPO_JUPYTER:$USE_VERSION
- echo "docker push ${REPO_JUPYTER}"
- docker push $REPO_JUPYTER
- echo "docker push ${REPO_JUPYTER}:${USE_VERSION}"
- docker push $REPO_JUPYTER:$USE_VERSION