-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
34 lines (27 loc) · 1.29 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
sudo: 'required'
services:
- docker
# Build and test the images (if this step fails the whole Travis build is considered a failure).
script:
# # NOTE FOR MASTER BRANCH: tensorflow version should match the version tags from https://hub.docker.com/r/tensorflow/tensorflow/tags, i.e. "1.14.0", "1.15.0", "2.0.0" etc.
# - tensorflow_version="1.14.0"
# Use current branch to get tensorflow docker tag
- git_branch=$TRAVIS_BRANCH
- tag=$git_branch
- tensorflow_version="${git_branch#tf-}" # remove prefix
- tensorflow_version="${tensorflow_version%-*}" # remove suffix
- image="pharmbio-notebook"
- echo "tensorflow_version=$tensorflow_version"
- echo "tag=$tag"
- echo "image=$image"
# Build CPU and GPU version of this tensorflow docker
- docker build -t pharmbio/$image:$tag . --build-arg BASE_IMAGE=tensorflow/tensorflow:${tensorflow_version}-jupyter
- docker build -t pharmbio/$image:${tag}-gpu . --build-arg BASE_IMAGE=tensorflow/tensorflow:${tensorflow_version}-gpu-jupyter
# Test containers
- docker run pharmbio/$image:$tag jupyter --version
- docker run pharmbio/$image:${tag}-gpu jupyter --version
after_success:
# Login and push image
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD ;
- docker push pharmbio/$image:$tag
- docker push pharmbio/$image:${tag}-gpu