[katello-devel] Gemfile split
Lukas Zapletal
lzap at redhat.com
Wed Dec 5 13:32:16 UTC 2012
Hello,
my Gemfile split PR was finally merged and I am happy to deliver this
for Katello 1.2. More in the upcoming blog post, but the main thing is:
Gemfile now only lists production gems, all other groups are in bundle.d
directory:
$ ls bundler.d/ -1
apipie.rb
coverage.rb
debugging.rb
development_boost.rb
development.rb
foreman.rb
checking.rb
profiling.rb
test.rb
The change is not bringing any change in bundler behavior, everything
remains the same except the gems are in different files. I also
reordered them, cleaned it out, put several TODOs there and also I have
split development and test into two separate groups.
During development you usually work with bundler while on production
setup or RPM-development setup you have bundler_ext enabled. To enable
bundler_ext install all RPM dependencies and then rename Gemfile as
Gemfile.in - that's it. Rename back and you have bundler back.
The most important bit that loads groups was extended a bit:
https://gist.github.com/4215458
Short description. With bundler enabled, we load the following groups:
production -> default, foreman
development -> ditto + development, apipie, development_boost
test -> ditto + test, debugging
In bundler_ext mode we load them ALL by default so you can install or
remove various katello "plugins" giving you gems you want. We currently
only have the following devel "plugins":
* katello-devel-all (installs all groups bellow)
* katello-devel (development rubygem group)
* katello-devel-test (unit testing rubygem group)
* katello-devel-profiling (profiling rubygem group)
* katello-devel-checking (javascript analysis rubygem group)
* katello-devel-coverage (test coverage measurement group)
* katello-devel-debugging (ruby debugger dependencies)
Well yeah, there actually IS the first plugin called "foreman". The
bundler.d/foreman.rb is only installed when you install
katello-glue-foreman. Without it, katello do not need foreman_api
rubygem.
There is one exception in the bundler_ext mode - if webmock is found and
Rails environment is not "test", we disable it's mocking capabilities
because it development or production mode with katello-devel-test
package installed it was causing issues (blocking from HTTP queries).
Therefore to use test rake tasks in RPM-based dev setup, use this:
RAILS_ENV=test rake test xyz ...
By the way, this made RPM Development Setup even more simple:
https://fedorahosted.org/katello/wiki/DevelopmentSetup
The shortest possible path now:
1) Install katello
2) Install katello-devel-all
3) Set KATELLO_ENV=development in the sysconfig file
4) Restart
LZ
--
Later,
Lukas "lzap" Zapletal
#katello #systemengine
More information about the katello-devel
mailing list