Project

General

Profile

« Previous | Next » 

Revision afd03fb8

Added by Dominic Cleal almost 8 years ago

Use foreman-ruby to run bundler in plugin build scripts

Fixes builds of plugins on OSes such as trusty where the default Ruby is
different to the foreman-ruby version, causing `foreman` installation
errors as gems are missing the correct `ruby-dev` package.

View differences:

plugins/ruby-foreman-tasks/debian/rules
cp cache/* /usr/share/foreman/vendor/cache/
cp $(PLUGIN).rb /usr/share/foreman/bundler.d/
cd /usr/share/foreman && ( \
bundle install --local && \
bundle exec rake plugin:assets:precompile[foreman_tasks] RAILS_ENV=production && \
bundle exec rake db:migrate RAILS_ENV=development && \
bundle exec rake plugin:apipie:cache[$(PLUGIN)] cache_part=resources \
/usr/bin/foreman-ruby /usr/bin/bundle install --local && \
/usr/bin/foreman-ruby /usr/bin/bundle exec rake plugin:assets:precompile[foreman_tasks] RAILS_ENV=production && \
/usr/bin/foreman-ruby /usr/bin/bundle exec rake db:migrate RAILS_ENV=development && \
/usr/bin/foreman-ruby /usr/bin/bundle exec rake plugin:apipie:cache[$(PLUGIN)] cache_part=resources \
OUT=/var/lib/foreman/public/apipie-cache/plugin/$(PLUGIN) RAILS_ENV=development \
)
GEM_PATH=$$(cd /usr/share/foreman && bundle show $(PLUGIN)) && \
GEM_PATH=$$(cd /usr/share/foreman && /usr/bin/foreman-ruby /usr/bin/bundle show $(PLUGIN)) && \
cp -rp $${GEM_PATH}/public/assets ./
[ -e apipie-cache ] || mkdir apipie-cache/
cp -rp /var/lib/foreman/public/apipie-cache/plugin/$(PLUGIN) ./apipie-cache/

Also available in: Unified diff