Skip to content

add simple deployment recipe #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions recipes/deployment.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
after_everything do
run "ln -s #{destination_root} ~/.pow/#{app_name}"

gsub_file 'Gemfile', /gem 'sqlite3'\n/, ''
gem 'pg', :group => :production
gem 'sqlite3', :group => [:development, :test]
run 'bundle install'

gsub_file 'config/application.rb', /config.assets.enabled = true/ do
<<-RUBY
config.assets.enabled = true
config.assets.initialize_on_precompile=false
RUBY
end

%w{
public/index.html
app/assets/images/rails.png
}.each { |file| remove_file file }

run "heroku create"
run "rake assets:precompile"
git :add => "."
git :commit => "-a -m 'initial commit for heroku'"
run "git push origin master"
run "git push heroku master"

# SET ENVIRONMENT VARIABLES BEFORE SEEDING DB
run "heroku config:add 'ROLES=[admin, user, VIP]'"
run "heroku config:add ADMIN_NAME='First User' ADMIN_EMAIL='[email protected]' ADMIN_PASSWORD='please'"
run "heroku config"

run "heroku run rake db:migrate"
run "heroku run rake db:seed"
end

__END__

name: deployment
description: "Set up POW and delpoy to Heroku"
author: David

requires: []
run_after: [init]
category: deployment