capistrano-unformatt 2.0 → 2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ce9932d827a5bea729294644d71450468d531aec
4
- data.tar.gz: 67615dbf4b891cc2f6f07cc7651229211a510d8e
3
+ metadata.gz: cd2d1f6e3286697ea327d825b0ac10896feacb19
4
+ data.tar.gz: 1a619611105567559684c4dd92ca150f5b47f913
5
5
  SHA512:
6
- metadata.gz: de2104371536f967fe3e23dcfeb88728377ab11f95da4a086c56c1da01de6dd7366a95b4a168826b751cdef05d58c7eaea4a8a439328a3e6a0b266ca44ceabe3
7
- data.tar.gz: 283fffcb4e617f9aeeb88d23616a0add00a6253a04519252d8bc3aedeeae21261799a1e9ddae7da671ba79b2449d440cd0a9465766b2990dd42905660cc4fa76
6
+ metadata.gz: cfc4f5d1f8acfe764506aef882d1b466b5b33f3188f0b146fdadefb864d83529fbf4884a906f6355d355f21a4f2ead18db8b7f647c96ffa8c7b1b96ea187ea52
7
+ data.tar.gz: c9115b1c04a76a403ed557376922b9e260df5445f004629c4bfdead75a1e34e452e43e1d3f47853b0e3c64a11143036c4dd9d97f89efb73c7e2308c52556848a
data/CHANGELOG.md CHANGED
@@ -97,3 +97,7 @@
97
97
  ## v2.0
98
98
 
99
99
  * Added methods for partial setup, improved check on daemon services
100
+
101
+ ## v2.1
102
+
103
+ * Fixes on deploy install, improved methods for partial setup
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "capistrano-unformatt"
7
- spec.version = '2.0'
7
+ spec.version = '2.1'
8
8
  spec.authors = ["unformatt"]
9
9
  spec.email = ["unformatt@gmail.com"]
10
10
  spec.description = "Custom recipes for Unformatt projects"
@@ -1,39 +1,41 @@
1
1
  namespace :deploy do
2
2
  namespace :install do
3
- namespace :yml do
4
- fetch(:setup_yamls, []).each do |yaml|
5
- desc "Creates yaml file for #{yaml}."
6
- task yaml do
7
- append :templating_paths, File.expand_path('../../../vendor/templates', File.dirname(__FILE__))
3
+ desc "Creates config for yml"
4
+ task :yaml, :command do |task, args|
5
+ append :templating_paths, File.expand_path('../../../vendor/templates', File.dirname(__FILE__))
8
6
 
9
- on roles :app do
10
- execute "mkdir -p #{shared_path}/{config,tmp,log,pids}"
7
+ on roles :app do
8
+ execute "mkdir -p #{shared_path}/{config,tmp,log,pids}"
11
9
 
12
- template "#{yaml}.yml.erb", "#{shared_path}/config/#{yaml}.yml"
13
- end
10
+ yamls = fetch(:setup_yamls, [])
11
+ yamls.keep_if { |x| args[:command].split('/').map(&:strip).include?(x.to_s) }
12
+
13
+ yamls.each do |yaml|
14
+ template "#{yaml}.yml.erb", "#{shared_path}/config/#{yaml}.yml"
14
15
  end
15
16
  end
16
17
  end
17
18
 
18
- namespace :daemon do
19
- fetch(:setup_daemons, []).each do |daemon|
20
- desc "Creates daemon files for #{daemon}."
21
- task daemon do
22
- append :templating_paths, File.expand_path('../../../vendor/templates', File.dirname(__FILE__))
23
-
24
- on roles :app do
25
- execute "mkdir -p #{shared_path}/{config,tmp,log,pids}"
19
+ desc "Creates config for daemon"
20
+ task :daemon, :command do |task, args|
21
+ append :templating_paths, File.expand_path('../../../vendor/templates', File.dirname(__FILE__))
26
22
 
27
- if daemon[:config] == true
28
- template "#{daemon[:name]}.rb.erb", "#{shared_path}/config/#{daemon[:name]}.rb", 0644
29
- end
23
+ on roles :app do
24
+ execute "mkdir -p #{shared_path}/{config,tmp,log,pids}"
30
25
 
31
- template "#{daemon[:name]}.daemon.erb", "#{shared_path}/tmp/#{daemon[:name]}.daemon", 0755
32
- execute "sudo mv -f #{shared_path}/tmp/#{daemon[:name]}.daemon #{fetch(:daemons_path)}/#{fetch(:application)}-#{daemon[:name]}"
26
+ daemons = fetch(:setup_daemons, [])
27
+ daemons.keep_if { |x| args[:command].split('/').map(&:strip).include?(x[:name].to_s) }
33
28
 
34
- template "#{daemon[:name]}.monit.erb", "#{shared_path}/tmp/#{daemon[:name]}.monit", 0644
35
- execute "sudo mv -f #{shared_path}/tmp/#{daemon[:name]}.monit #{fetch(:monit_scripts_path)}/#{fetch(:application)}-#{daemon[:name]}"
29
+ daemons.each do |daemon|
30
+ if daemon[:config] == true
31
+ template "#{daemon[:name]}.rb.erb", "#{shared_path}/config/#{daemon[:name]}.rb", 0644
36
32
  end
33
+
34
+ template "#{daemon[:name]}.daemon.erb", "#{shared_path}/tmp/#{daemon[:name]}.daemon", 0755
35
+ execute "sudo mv -f #{shared_path}/tmp/#{daemon[:name]}.daemon #{fetch(:daemons_path)}/#{fetch(:application)}-#{daemon[:name]}"
36
+
37
+ template "#{daemon[:name]}.monit.erb", "#{shared_path}/tmp/#{daemon[:name]}.monit", 0644
38
+ execute "sudo mv -f #{shared_path}/tmp/#{daemon[:name]}.monit #{fetch(:monit_scripts_path)}/#{fetch(:application)}-#{daemon[:name]}"
37
39
  end
38
40
  end
39
41
  end
@@ -54,15 +56,13 @@ namespace :deploy do
54
56
  desc "Creates all project files."
55
57
  task :all do
56
58
  unless ENV['SKIP_YAMLS'] == 'true'
57
- fetch(:setup_yamls, []).each do |yaml|
58
- invoke "deploy:install:yml:#{yaml}"
59
- end
59
+ yaml_names_param = fetch(:setup_yamls, []).map { |x| x.to_s }.join('/')
60
+ invoke "deploy:install:yaml[#{yaml_names_param}]"
60
61
  end
61
62
 
62
63
  unless ENV['SKIP_DAEMONS'] == 'true'
63
- fetch(:setup_daemons, []).each do |daemon|
64
- invoke "deploy:install:daemon:#{daemon}"
65
- end
64
+ daemon_names_param = fetch(:setup_daemons, []).map { |x| x[:name].to_s }.join('/')
65
+ invoke "deploy:install:daemon[#{daemon_names_param}]"
66
66
  end
67
67
 
68
68
  if fetch(:setup_nginx, false) == true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-unformatt
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.0'
4
+ version: '2.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - unformatt