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 +4 -4
- data/deploy-mate.gemspec +1 -1
- data/lib/capistrano/configs/{unicorn.pill.erb → application.pill.erb} +13 -1
- data/lib/capistrano/configs/upstart.conf.erb +1 -1
- data/lib/capistrano/tasks/bluepill.rake +1 -1
- data/lib/capistrano/tasks/machine.rake +1 -0
- data/lib/capistrano/tasks/nginx.rake +2 -0
- data/lib/deploy_mate/tasks.rake +17 -12
- data/lib/deploy_mate/templates/Capfile.erb +2 -1
- data/lib/deploy_mate/templates/deploy.rb.erb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14882d055c45f84057957cb143d5126ee0c12006
|
4
|
+
data.tar.gz: b78d5446177e2e0e24ad63714a42185c6cf3c786
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be7b2f88daea3077d8db2f78e45a88108e3e894802ae5aeab5e23b778df467d32cbeb0765184a630a2fa99dc2c25119717e511e345c6e88fc5c62af1dde856ba
|
7
|
+
data.tar.gz: 90a21e17e5d3ffce0571495c7b4abb48a98ca3429c9dd7db18f2920233c7cfa71234331bb2b4cc26a6f030c1d1d72853df4a8e6951091c4a6967a3fcdad42e4d
|
data/deploy-mate.gemspec
CHANGED
@@ -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
|
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 "
|
7
|
+
template "application.pill.erb", "#{shared_path}/config/#{fetch(:application)}.pill"
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
data/lib/deploy_mate/tasks.rake
CHANGED
@@ -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
|
-
@
|
11
|
-
@
|
12
|
-
@
|
13
|
-
@
|
14
|
-
@
|
15
|
-
@
|
16
|
-
@
|
17
|
-
@
|
18
|
-
@
|
19
|
-
@
|
20
|
-
@
|
21
|
-
@
|
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
|
@@ -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,
|
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.
|
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
|