How to use RVM w / Hudson CI server on Debian?

I am trying to set up an automated build server for my rail projects using Hudson CI. So he is able to run specifications and do metrics for the code, but I have 2 different projects, depending on two different versions of the ruby. So I'm trying to use RVM to run multiple copies of ruby, and then switch back and forth at the pre-build stage.

I found a couple of posts, like this one , that try to explain how to make this work, but I do not start the script run for hudson, it starts at boot, since it worked out of the box when I installed it using the debian instructions.

The problem is that despite the fact that hudson runs under the hudson account, and that rvm account is (and works) when it tries to run the shell-based prebuild step to invoke the 1.8.7 rvm switch, it does not work with error "rvm: command not found"

Not sure what I'm doing wrong. Hudson uses SH as his shell, but I also tried using bash. bad luck.

Has anyone got this job before in this setup?

+4
source share
2 answers

I had the same symptoms as you.

After a couple of hours of headbanging, check the $ HOME environment variable for Hudson (you can see http: // yourserver / hudson / systemInfo ).

In Ubuntu, Tomcat 6 start script does not install $ HOME. Somehow, Hudson inherited my $ HOME instead!

I added HOME = $ CATALINA_HOME to the /etc/init.d/tomcat6 script just below the rest of the ENV declarations, and now it all works. Very annoying problem, of course.

+1
source

edit "/etc/init.d/hudson" (!) and change the line:

 SU=/bin/su 

... change to:

 SU="/bin/su -" 

... and add the rvm setting to / home / hudson / .profile

+3
source

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


All Articles