drewdeponte / octopusci

A multi-branch continuous integration server
MIT License
19 stars 2 forks source link

Figure out how to execute octopusci-skel cmd using sudo in devel #30

Closed drewdeponte closed 12 years ago

drewdeponte commented 13 years ago

It seems there is some sort of issue using sudo in devel to run the octopusci-skel command. It looks to be some how related to bundler. The output of the failure looks as follows:

[octopusci (master *=)]$ sudo ./bin/octopusci-skel 
Password:
/Users/adeponte/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- trollop (LoadError)
    from /Users/adeponte/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from ./bin/octopusci-skel:8:in `<main>'
[octopusci (master *=)]$ 

For some reason it can't seem to find the gems that were installed by bundler when I use sudo for some reason.

drewdeponte commented 13 years ago

Technically its not the greatest thing that this command requires root. It may be better to have Octopusci basically have its own user account on production servers and have it install its workspace and configuration files relative to that home directory rather than in /etc/octopusci. Then the octopusci user could be setup as the user that would run the tentacles and jobs. This seems like a much better idea from a security stand point. Beyond that it would prevent this sudo bundle issue for devs.

drewdeponte commented 12 years ago

However, it would still require sudo on some command to create the initial user account and do that setup. In order to run sudo commands in dev simply use rvmsudo instead of sudo that way it knows about the gems in the rvm gem set.

drewdeponte commented 12 years ago

rvmsudo is the magic for in dev. The problem shouldn't exist in production.