Skip to content

Commit f42fb76

Browse files
authored
Use TRAVIS_BUILD_DIR to replace hard-coded build dir name (#145)
This helps when a fork uses a different name. * use TRAVIS_BUILD_DIR to replace hard-coded build dir name * cp to the right location
1 parent 973e9da commit f42fb76

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.travis.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ install:
6363
apt-get install -y curl openjdk-8-jdk bzip2"
6464

6565
# Copy the current dir into the docker container
66-
- docker cp `pwd` ubuntu-test:$HOME/
66+
- docker exec -t ubuntu-test bash -c "mkdir -p $TRAVIS_BUILD_DIR"
67+
- docker cp `pwd`/. ubuntu-test:$TRAVIS_BUILD_DIR
6768

6869
# Download and set up miniconda
6970
- docker exec -t ubuntu-test bash -c "
@@ -78,20 +79,20 @@ install:
7879
# Activate conda environment ad install required packages
7980
- docker exec -t ubuntu-test bash -c "
8081
source $HOME/miniconda/bin/activate test-environment;
81-
pip install --user -r $HOME/spark-deep-learning/dev/dev-requirements.txt;
82-
pip install --user -r $HOME/spark-deep-learning/python/requirements.txt;"
82+
pip install --user -r $TRAVIS_BUILD_DIR/dev/dev-requirements.txt;
83+
pip install --user -r $TRAVIS_BUILD_DIR/python/requirements.txt;"
8384

8485
script:
8586
- docker cp $HOME/.cache ubuntu-test:$HOME/
8687
# build assembly
8788
- docker exec -t ubuntu-test bash -c "
8889
source $HOME/miniconda/bin/activate test-environment;
89-
cd $HOME/spark-deep-learning;
90+
cd $TRAVIS_BUILD_DIR;
9091
./dev/run.py assembly"
9192
# run python style and test suites
9293
- docker exec -t ubuntu-test bash -c "
9394
source $HOME/miniconda/bin/activate test-environment;
94-
cd $HOME/spark-deep-learning;
95+
cd $TRAVIS_BUILD_DIR;
9596
./dev/run.py $TEST_SUITE"
9697

9798
after_success:
@@ -100,5 +101,5 @@ after_success:
100101
- docker exec -t ubuntu-test bash -c "
101102
source $HOME/miniconda/bin/activate test-environment;
102103
$HOME/miniconda/bin/conda install -c anaconda coverage;
103-
cd $HOME/spark-deep-learning;
104+
cd $TRAVIS_BUILD_DIR;
104105
bash <(curl -s https://codecov.io/bash)"

0 commit comments

Comments
 (0)