Skip to content

Instantly share code, notes, and snippets.

@bernd
Created January 21, 2014 22:18
Show Gist options
  • Save bernd/8549621 to your computer and use it in GitHub Desktop.
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)
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
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