Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Travis CI edit my files?

I'm new to Travis CI and I simply want to understand why and what is going on here. I've followed the instructions for setup in their documentation to the best of my ability. What I've got is:

  • My Rails code on Github
  • Travis CI that build my repo as soon as it is pushed to the github branch master.
  • A Heroku app to where Travis CI deploys the code if the build is successful.

What I can't grasp is why I get this when the build is finished:

HEAD detached from 2a3b308
Changes not staged for commit:
.......
modified:   script/travis.sh

Untracked files:
  (use "git add <file>..." to include in what will be committed)

   vendor/bundle/

no changes added to commit (use "git add" and/or "git commit -a")

I do a before_install: - chmod +x script/travis.sh in my .travis.yml and I get chmod +x script/travis.sh in my build log. I have git version 2.7.4

Why is my script/travis.sh edited? Should I add those changes or is something wrong in my setup? In the script/travis.sh I've got some minor commands to be executed before the build, setting up my Github identity and such.

Why is this folder vendor/bundle/ added?

like image 561
bork Avatar asked Mar 04 '17 07:03

bork


People also ask

What is Travis CI used for?

As a continuous integration platform, Travis CI supports your development process by automatically building and testing code changes, providing immediate feedback on the success of the change. Travis CI can also automate other parts of your development process by managing deployments and notifications.

Which file is used to configure the Travis CI?

3) To set up a build environment and prepare the build, Travis CI's system fetches and processes the . travis. yml config file from the repository and the branch explicitly specified in the build request, triggered by GitHub.

How does Travis CI work with GitHub?

Travis CI is a cloud-based CI service that builds and tests your projects hosted on GitHub. It would trigger a build process to validate the build and report any failures for every commit made. It fetches the commands from a . travis.

Is Travis CI a tool?

Travis CI is a commercial CI tool, whereas Jenkins is an open-source tool.


1 Answers

You would need to add a git diff step to see the nature of the change, but check your travis logs: if you see

chmod a+x travis.sh

That means your original travis.sh script was not added as executable.

In your repo, do a (with Git 2.9.1+):

git add --chmod=+x script/travis.sh
git commit -m "Make travis.sh executable"
git push

Then check again if travis still displays your file as modified after a build.


Regarding vendor/bundle/, it is not "added", simply generated and untracked, which means your repo is not modified.
See Travis/Cache Bundle

On Ruby and Objective-C projects, installing dependencies via Bundler can make up a large portion of the build duration. Caching the bundle between builds drastically reduces the time a build takes to run.

If you have custom Bundler arguments, and these include the --path option, Travis CI will use that path. If --path is missing but --deployment is present, it will use vendor/bundle.

like image 143
VonC Avatar answered Sep 30 '22 04:09

VonC