Created
February 14, 2018 15:57
-
-
Save etiennebr/dd87533bea69129b2cdae69a123f8513 to your computer and use it in GitHub Desktop.
Run travis-ci locally using R-base docker image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# adapted from: https://stackoverflow.com/a/41935867/171659 | |
# choose the image according to the language chosen in .travis.yml | |
mkdir -p "$PWD":/home/docker | |
docker run -ti --rm -v "$PWD":/home/docker -w /home/docker -u docker r-base /bin/bash | |
# now that you are in the docker image, switch to the travis user | |
sudo - travis | |
apt-get install ruby | |
# Install travis-build to generate a .sh out of .travis.yml | |
mkdir builds | |
cd builds | |
git clone https://github.com/travis-ci/travis-build.git | |
cd travis-build | |
gem install travis | |
# to create ~/.travis | |
travis version | |
ln -s `pwd` ~/.travis/travis-build | |
bundle install | |
# Create project dir, assuming your project is `AUTHOR/PROJECT` on GitHub | |
cd ~/builds | |
mkdir AUTHOR | |
cd AUTHOR | |
git clone https://github.com/AUTHOR/PROJECT.git | |
cd PROJECT | |
# change to the branch or commit you want to investigate | |
travis compile > ci.sh | |
# You most likely will need to edit ci.sh as it ignores matrix and env | |
bash ci.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment