Created
January 21, 2014 22:18
-
-
Save bernd/8549621 to your computer and use it in GitHub Desktop.
Simple example to package a Rails app with fpm-cookery. (missing some setup for permissions, etc)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RailsApp < FPM::Cookery::Recipe | |
description 'A rails app' | |
name 'my-rails-app' | |
version '1.0' | |
source '/tmp/foo', :with => :git | |
def build | |
gemhome = Pathname.pwd.join('.gemhome').to_s | |
ENV['GEM_HOME'] = gemhome | |
safesystem('gem install bundler') | |
safesystem("#{gemhome}/bin/bundle install --deployment --without development:test") | |
end | |
def install | |
share('my-rails-app').install Dir['*'] | |
share('my-rails-app').install %w(.bundle .gitignore .gemhome) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fpm-cook fpm-cookery-rails-app.rb | |
sudo dpkg -i pkg/my-rails-app_1.0+fpm0_amd64.deb | |
cd /usr/share/my-rails-app | |
export GEM_DIR=$PWD/.gemhome GEM_PATH= | |
.gemhome/bin/bundle exec rails s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment