Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Test travis-ci script without commit on github

Always that I need to test some change on .travis file I need to push my commit to github, and if it fail, it is a problem, I would like to know, if there are any way to test my .travis file before commit it, preferably on travis-ci vm, it means I want to make the process that travis does when I push some commti to github, but without need to commit or push my changes.

like image 731
Alex Avatar asked Apr 26 '17 03:04

Alex


1 Answers

You can run Travis-CI locally, in a docker image, in order to test your travis-ci.yml configuration file.

See "How to Run TravisCI locally on Docker": you can open a travis bash with:

docker run -it -u travis quay.io/travisci/travis-jvm /bin/bash

That article is about giving that local Travis instance access to your GitHub repo, but in your case, you can make a docker image (based on one of the Travis-CI ones) which would mount the local repo folder you have on your machine, and will be able to do a travis compile in that mounted folder within the container.

If the test passes in your local Travis-CI, then you can push your local commits to your GitHub repo.

like image 83
VonC Avatar answered Oct 12 '22 04:10

VonC