Sometimes we have a private repository to hold both problems and solutions as a reference for the class projects. The students can see only the problems in a public repository where they are able to clone/fork and develop their own solutions. We do not want the solution files in the public repository and each bug found/feature added in the project requires a push for each repository. It would be cool to work only with the reference repo and use tests to see if our modification is good enough for the public release. This is possible with Travis-CI following simple steps:
- Create private and public repos
- Install Ruby
- Install Travis gem
gem install travis
- Generate a token in the Github website to allow others to play with your repos (copy the hash)
- Log into your git account
- Generate a secure token with the Travis gem (copy long hash)
- Fill the environment variables in the
.travis.yml
file (USER, EMAIL, REPO, FILES) - Replace the value of secure with your long hash
- Replace TRAVIS_SECURE_TOKEN_NAME with your Travis token name
- Push
.travis.yml
to private repo - Go to Travis to unlock your private repo tests
- Push your files to the private repo to test
Travis now has a deployment feature, which may be better for certain scenarios.
Thank you. It works for me.