Class: Pushapp::Generators
- Inherits:
-
Thor
- Object
- Thor
- Pushapp::Generators
- Includes:
- Thor::Actions
- Defined in:
- lib/pushapp/generators.rb
Instance Method Summary collapse
- #chef_solo(remote) ⇒ Object
- #unicorn(remote) ⇒ Object
- #unicorn_nginx(remote) ⇒ Object
- #unicorn_upstart ⇒ Object
- #web(remote) ⇒ Object
Instance Method Details
#chef_solo(remote) ⇒ Object
81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/pushapp/generators.rb', line 81 def chef_solo(remote) [:remote] = remote template 'Cheffile.erb', 'config/deploys/chef/Cheffile' template 'Vagrantfile.erb', 'config/deploys/chef/Vagrantfile' template 'knife.rb.erb', 'config/deploys/chef/.chef/knife.rb' template 'node.json.erb', "config/deploys/chef/nodes/#{app_host}.json" template 'user.json.erb', "config/deploys/chef/data_bags/users/#{app_user}.json" template 'chef.gitignore', 'config/deploys/chef/.gitignore' end |
#unicorn(remote) ⇒ Object
48 49 50 51 52 |
# File 'lib/pushapp/generators.rb', line 48 def unicorn(remote) [:remote] = remote template 'unicorn.rb.erb', 'config/unicorn.rb' puts "NOTE: add tmp/pids to your git repo. ( touch tmp/pids/.keep && git add tmp/pids/.keep -f )" end |
#unicorn_nginx(remote) ⇒ Object
36 37 38 39 |
# File 'lib/pushapp/generators.rb', line 36 def unicorn_nginx(remote) [:remote] = remote template 'unicorn_nginx.conf.erb', "config/deploys/#{app_name}.nginx.conf" end |
#unicorn_upstart ⇒ Object
42 43 44 45 |
# File 'lib/pushapp/generators.rb', line 42 def unicorn_upstart template 'unicorn_upstart.erb', 'bin/unicorn_upstart' chmod 'bin/unicorn_upstart', 'a+x' end |
#web(remote) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/pushapp/generators.rb', line 16 def web(remote) [:remote] [:listen] = "80" uncomment_lines 'Gemfile', /gem 'unicorn'/ uncomment_lines 'Gemfile', /gem 'therubyracer'/ insert_into_file 'Gemfile', "\ngem 'pushapp'\ngem 'foreman'\ngem 'dotenv-rails'", after: /gem 'unicorn'/ unicorn_upstart unicorn_nginx(remote) unicorn(remote) template 'Procfile' template '.env.erb', ".env.#{app_env}" end |