deploy_mate 0.15 → 0.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 010748fec2c76a90ba7f99433ee1f5045980f40f
4
- data.tar.gz: 4b5007ee4f0fcd32c37d0053a95e28d9935fb3bd
3
+ metadata.gz: 14882d055c45f84057957cb143d5126ee0c12006
4
+ data.tar.gz: b78d5446177e2e0e24ad63714a42185c6cf3c786
5
5
  SHA512:
6
- metadata.gz: cafffbfdaec1aad29f7cedbeff29878d94e1fc67864eda988a75d03f5741bdc08437fef20a28d8857968b21223af752a9bd43974c0c15e1e07dc381a1d6cc854
7
- data.tar.gz: 1b5a3e7443df511271b70be63c40b49e0617131ffc5261940c012383420e5264e2912818249b5e0c52b1f7b3a19a79d55295355a7a0d148b42b8db18b9018644
6
+ metadata.gz: be7b2f88daea3077d8db2f78e45a88108e3e894802ae5aeab5e23b778df467d32cbeb0765184a630a2fa99dc2c25119717e511e345c6e88fc5c62af1dde856ba
7
+ data.tar.gz: 90a21e17e5d3ffce0571495c7b4abb48a98ca3429c9dd7db18f2920233c7cfa71234331bb2b4cc26a6f030c1d1d72853df4a8e6951091c4a6967a3fcdad42e4d
data/deploy-mate.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "deploy_mate"
3
- s.version = "0.15"
3
+ s.version = "0.16"
4
4
 
5
5
  s.authors = ["Tim Adler"]
6
6
  s.date = %q{2015-06-23}
@@ -6,6 +6,7 @@ Bluepill.application("<%= fetch(:application) %>", :log_file => "#{shared_path}/
6
6
  app.working_dir = current_path
7
7
  app.uid = 'ubuntu'
8
8
  app.gid = 'www-data'
9
+
9
10
  app.process("unicorn") do |process|
10
11
  process.pid_file = "#{shared_path}/system/pids/unicorn.pid"
11
12
  process.environment = { 'BUNDLE_GEMFILE' => "#{current_path}/Gemfile" }
@@ -20,9 +21,20 @@ Bluepill.application("<%= fetch(:application) %>", :log_file => "#{shared_path}/
20
21
 
21
22
  process.monitor_children do |child_process|
22
23
  child_process.stop_command = "kill -9 {{PID}}"
23
-
24
24
  child_process.checks :mem_usage, :every => 30.seconds, :below => 500.megabytes, :times => [3,4], :fires => :stop
25
25
  end
26
26
  end
27
27
 
28
+ <% if fetch(:sidekiq) %>
29
+ app.process("sidekiq") do |process|
30
+ process.pid_file = "#{shared_path}/system/pids/sidekiq.pid"
31
+
32
+ process.start_command = "/home/ubuntu/.rvm/wrappers/default/bundle exec sidekiq -e <%= fetch(:environment) %> -C #{current_path}/config/sidekiq.yml -i 0 -P #{shared_path}/pids/sidekiq.pid"
33
+ process.stop_command = "kill -QUIT {{PID}}"
34
+
35
+ process.start_grace_time = 10.seconds
36
+ process.stop_grace_time = 10.seconds
37
+ end
38
+ <% end %>
39
+
28
40
  end
@@ -4,6 +4,6 @@ start on runlevel [2]
4
4
  stop on runlevel [016]
5
5
 
6
6
  expect daemon
7
- exec /home/ubuntu/.rvm/wrappers/default/bluepill load <%= shared_path %>/config/unicorn.pill
7
+ exec /home/ubuntu/.rvm/wrappers/default/bluepill load <%= shared_path %>/config/<%= fetch(:application)%>.pill
8
8
 
9
9
  respawn
@@ -4,7 +4,7 @@ namespace :bluepill do
4
4
  task :setup do
5
5
  on roles(:app) do
6
6
  execute "mkdir -p #{shared_path}/config"
7
- template "unicorn.pill.erb", "#{shared_path}/config/unicorn.pill"
7
+ template "application.pill.erb", "#{shared_path}/config/#{fetch(:application)}.pill"
8
8
  end
9
9
  end
10
10
 
@@ -166,6 +166,7 @@ namespace :machine do
166
166
  unless is_package_installed?("imagemagick")
167
167
  apt_get_install("imagemagick")
168
168
  apt_get_install("libmagickcore-dev")
169
+ apt_get_install("libmagickwand-dev")
169
170
  end
170
171
  end
171
172
  end
@@ -14,6 +14,8 @@ namespace :nginx do
14
14
  sudo "rm /etc/nginx/sites-enabled/default"
15
15
  end
16
16
 
17
+ execute "mkdir -p #{shared_path}/log"
18
+
17
19
  invoke "nginx:enable_site"
18
20
  invoke "nginx:reload"
19
21
  end
@@ -7,18 +7,19 @@ namespace :deploy_mate do
7
7
  puts "I'm your DEPLOY_MATE."
8
8
  puts "We will setting up your deployment now."
9
9
 
10
- @ssh_name = ask("[01/12] SSH-Hostname for the server", "#{@app_name}-#{@stage_name}")
11
- @ruby_version = ask("[02/12] Ruby-Version (the RVM-way, e.g. ruby-2.2.0)", guess_ruby_version)
12
- @app_name = ask("[03/12] App-Name (for nginx, servers, etc.)", guess_app_name)
13
- @repo_url = ask("[04/12] Url-Location of git-repo", "git@github.com:hanseventures/#{@app_name}.git")
14
- @is_rails = yes_or_no?("[05/12] Is this a RAILS project ?", (rails_present? ? "yes" : "no"))
15
- @needs_imagemagick = yes_or_no?("[06/12] Does this project need ImageMagick ?", (needs_imagemagick? ? "yes" : "no"))
16
- @stage_name = ask("[07/12] Give the first stage a name", "prestage")
17
- @branch_name = ask("[08/12] Branch to deploy '#{@stage_name}' from", "dev")
18
- @host_name = ask("[09/12] Web-URL for '#{@stage_name}'", "#{@stage_name}.#{@app_name}")
19
- @environment = ask("[10/12] #{@stage_name}'s environment (RACK_ENV/RAILS_ENV)", "#{@stage_name}")
20
- @db_engine = ask_until("[11/12] What db are you using?", %w( postgresql mysql ), "mysql")
21
- @needs_elasticsearch = yes_or_no?("[12/12] Do you need ElasticSearch on this machine ?", "no")
10
+ @app_name = ask("[01/13] App-Name (for nginx, servers, etc.)", guess_app_name)
11
+ @stage_name = ask("[02/13] Give the first stage a name", "prestage")
12
+ @ssh_name = ask("[03/13] SSH-Hostname for the server", "#{@app_name}-#{@stage_name}")
13
+ @ruby_version = ask("[04/13] Ruby-Version (the RVM-way, e.g. ruby-2.2.0)", guess_ruby_version)
14
+ @db_engine = ask_until("[05/13] What db are you using?", %w( postgresql mysql ), "mysql")
15
+ @repo_url = ask("[06/13] Url-Location of git-repo", "git@github.com:hanseventures/#{@app_name}.git")
16
+ @is_rails = yes_or_no?("[07/13] Is this a RAILS project ?", (rails_present? ? "yes" : "no"))
17
+ @needs_imagemagick = yes_or_no?("[08/13] Does this project need ImageMagick ?", (needs_imagemagick? ? "yes" : "no"))
18
+ @uses_sidekiq = yes_or_no?("[09/13] Does this project use Sidekiq ?", (uses_sidekiq? ? "yes" : "no"))
19
+ @branch_name = ask("[10/13] Branch to deploy '#{@stage_name}' from", "dev")
20
+ @host_name = ask("[11/13] Web-URL for '#{@stage_name}'", "#{@stage_name}.#{@app_name}")
21
+ @environment = ask("[12/13] #{@stage_name}'s environment (RACK_ENV/RAILS_ENV)", "#{@stage_name}")
22
+ @needs_elasticsearch = yes_or_no?("[13/13] Do you need ElasticSearch on this machine ?", "no")
22
23
 
23
24
  puts "Aye!"
24
25
  puts "Worrrrking..."
@@ -45,6 +46,10 @@ def config_template(from, to)
45
46
  puts "'#{to}'"
46
47
  end
47
48
 
49
+ def uses_sidekiq?
50
+ defined? Sidekiq
51
+ end
52
+
48
53
  def needs_imagemagick?
49
54
  defined? RMagick || defined? MiniMagick
50
55
  end
@@ -8,4 +8,5 @@ Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
8
8
  # Optionals
9
9
  # Uncomment, if needed
10
10
 
11
- # require "whenever/capistrano"
11
+ # require "whenever/capistrano"
12
+ # before 'deploy:restart', 'deploy:migrate', 'whenever:update_crontab'
@@ -11,7 +11,8 @@ set :default_stage, '<%= @stage_name %>'
11
11
  set :repo_url, '<%= @repo_url %>'
12
12
  set :db_engine, '<%= @db_engine %>'
13
13
 
14
- set :imagemagick, '<%= @needs_imagemagick %>'
14
+ set :imagemagick, <%= @needs_imagemagick %>
15
+ set :sidekiq, <%= @uses_sidekiq %>
15
16
 
16
17
  # Optionals
17
18
  # Uncomment, if needed
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deploy_mate
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.15'
4
+ version: '0.16'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Adler
@@ -82,10 +82,10 @@ files:
82
82
  - Rakefile
83
83
  - deploy-mate.gemspec
84
84
  - lib/capistrano/README.md
85
+ - lib/capistrano/configs/application.pill.erb
85
86
  - lib/capistrano/configs/logrotate.erb
86
87
  - lib/capistrano/configs/nginx_app.conf.erb
87
88
  - lib/capistrano/configs/nginx_base.conf.erb
88
- - lib/capistrano/configs/unicorn.pill.erb
89
89
  - lib/capistrano/configs/unicorn.rb.erb
90
90
  - lib/capistrano/configs/upstart.conf.erb
91
91
  - lib/capistrano/deploy_mate_capfile.rb