5

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?

bork
  • 1,556
  • 4
  • 21
  • 42

1 Answers1

5

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.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks for your reply. 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. – bork Mar 04 '17 at 07:33
  • Update: That fixed the problem with the `travis.sh` being modified. Now it's only the `vendor/bundle/` being added. – bork Mar 04 '17 at 07:40
  • Thanks. So in theory I don't have to do anything about it, right? But I think it look pretty ugly having that output. Can I filter it out somehow, or do I just have to accept that this is how it's going to be? – bork Mar 04 '17 at 08:42
  • @bork yes: add `vendor/bundle` to your `.gitignore` (the add, commit and push). That way, the travis git status at the end won't mention it. – VonC Mar 04 '17 at 08:46