Jenkins: Running RoR Builds w/ Bash & RVM

Back | jenkins | 9/6/2011 |

I went through a few iterations of running builds via shell commands in Jenkins. Once I added a remote node things didn’t work quite the same as on master. I learned that Jenkins creates a .sh file and executes it with -xe, so we can change the interpreter like this.

  1. #!/bin/bash
  2. source ~/.bash_profile
  3. bundle install
  4. bundle exec ...

This loads RVM from .bash_profile. You can add an rvm use in there if you are building with multiple versions of Ruby.