I cannot wrap my brain around the following thing … and I hope there’s an easy “rubyist” way to solve this.
I have a couple of linux servers that are all administrated through a bunch of ruby scripts with own config. All those scripts rely on a utils gem that is easily installed on all hosts with “gem install”.
The apps itself however are host dependend.
The ruby script that for example handles nightly database backups makes only sense on the database host. And the script that parses application server log files has nothing to do on the database host, aso.
With the utils gem it is easy. I just put it to our gem server and every host just fetches it. But the apps itself and their configs are copied over manually at the moment. But this is kind of stupid.
I’d really like to just package the app + config into its own ruby gem. This part is easy. But I then want the app-script to be installed to /usr/local/bin and the config files to go to /usr/local/etc. But I cannot figure out how I could tell a gemspec how to handle install paths per file, including owner change and possible forced manuall diff/automatic merge in case the config has changed.
I secretly try to get a chef-system started, which would solve all of the problems. But there are too many things going on here currently that prevent the setup of such an infrastructure … I cannot even use sprinkle … sadly. So it’s all pretty nasty at the moment.
So is there a way of telling my gemspec how to handle certain files or at least a way I can tell the gemspec to run a certain file on install so I can code my way around those problems?
Or maybe you’ve got similar situations and have a nice solution that works for you and you don’t mind sharing your wisdom with me?
Thx in advance,
Stefan
I would pack that app as a package. That is, make a .deb file on Debian/Ubuntu, .rpm on RedHat and so on.
This solves issues with placing executables and configs to proper folders.