Why is Travis CI editing my files?

I am new to Travis CI and I just want to understand why and what is happening here. I followed the setup instructions in my documentation as much as possible. I have:

  • My Rails Code on Github
  • Travis CI, which builds my repo as soon as it is transferred to the github branch master.
  • Heroku application where Travis CI deploys the code if the build is successful.

I cannot understand why I get this when the build is complete:

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 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 these changes or is there something wrong with my setup? In script/travis.sh , I have some minor commands that need to be run before building, setting up my Github authentication, etc.

Why is this vendor/bundle/ folder added?

+5
source share
1 answer

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

 chmod a+x travis.sh 

This means that your original travis.sh script was not added as an executable.

In your repo, do (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 build.


Regarding vendor/bundle/ it is not added, it is just generated and not tracked, which means that your repo is not changing.
See Travis / Cache Bundle

In Ruby and Objective-C projects, installing dependencies through the Bundler can be a significant part of the build time. Batch caching between assemblies significantly reduces the time it takes to complete the assembly.

If you have custom Bundler arguments and they include the --path , Travis CI will use this path. If --path absent, but --deployment present, it will use vendor/bundle .

+4
source

Source: https://habr.com/ru/post/1265018/


All Articles