capistrano-twingly 2.3.0 → 2.4.0

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
  SHA256:
3
- metadata.gz: aef60e39ce2b8e4a5218b7ffd0249b4d2c8409fc0eb3d2ae65f5f6d8ce80fa52
4
- data.tar.gz: c0bbdc520e398af97204b30ddeccb89d33326f6dd1c2f2136bde7be4db700de9
3
+ metadata.gz: 75fa4a0261e7641d6b29921d6dcfe7615790f703e6393e92d57147eb21a163c4
4
+ data.tar.gz: 00f98265254260053e4fe778f3dfd9df8d442d293a527c06bedcab2fb4d9d004
5
5
  SHA512:
6
- metadata.gz: 9f89921332157eaa1858d737a65ca284539a8a2e615947287f2dfafe3ae376bcbd7d04ab014a60fd05af2f31698627e2c59a2c0639762aeb2f803d692a6cb157
7
- data.tar.gz: d1bddf27f3bb9c280015c6d9bb5b4395f32d412a87a1eb657885da20a94c9da45e6e67322728a868a596fa29afea6a714cdbe746bea6cb6743e71ad77f5702ef
6
+ metadata.gz: bfaf032744fbf5f61a113f4c6702c5ca1d1b3a5a81cba5d5ed3f4765050d85724a9e384fd13ef317d78f029e3da8ec3b73ead1cc3d37d770b57e9455d56825a4
7
+ data.tar.gz: c3b2685e826ea9e7a0961becedb167ab506420733f144070c932d36748b538787ea4576e515438aa12e4929128c8a3350d7b7db7340cfd6d1c6bbc67d18ec1cb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Change Log
2
2
 
3
+ ## [v2.3.0](https://github.com/twingly/capistrano-twingly/tree/v2.3.0) (2018-10-04)
4
+ [Full Changelog](https://github.com/twingly/capistrano-twingly/compare/v2.2.0...v2.3.0)
5
+
6
+ **Merged pull requests:**
7
+
8
+ - Lookup app servers using multiple SRV records [\#42](https://github.com/twingly/capistrano-twingly/pull/42) ([roback](https://github.com/roback))
9
+
3
10
  ## [v2.2.0](https://github.com/twingly/capistrano-twingly/tree/v2.2.0) (2017-12-18)
4
11
  [Full Changelog](https://github.com/twingly/capistrano-twingly/compare/v2.1.0...v2.2.0)
5
12
 
data/README.md CHANGED
@@ -103,6 +103,21 @@ namespace :deploy do
103
103
  end
104
104
  ```
105
105
 
106
+ It's also possible to use a different Procfile for each host by setting `procfile_contents` to a Hash:
107
+
108
+ ```ruby
109
+ # config/deploy.rb
110
+ set :procfile_contents, -> {
111
+ servers = fetch(:servers_from_srv_record)
112
+
113
+ servers.each_with_object({}) do |hostname, procfiles_by_host|
114
+ contents = "web: CURRENT_HOST=#{hostname} bundle exec puma"
115
+
116
+ procfiles_by_host[hostname] = contents
117
+ end
118
+ }
119
+ ```
120
+
106
121
  ### Tag deploys in Git
107
122
 
108
123
  ```Ruby
@@ -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-twingly"
7
- spec.version = '2.3.0'
7
+ spec.version = '2.4.0'
8
8
  spec.authors = ["Twingly AB"]
9
9
  spec.email = ["support@twingly.com"]
10
10
  spec.summary = %q{Capistrano 3 tasks used for Twingly's Ruby deployment}
@@ -25,8 +25,8 @@ namespace :deploy do
25
25
  namespace :foreman do
26
26
  desc 'Upload Procfile to server'
27
27
  task :upload_procfile do
28
- on roles(:app) do
29
- upload! 'tmp/Procfile', "#{fetch(:deploy_to)}/current/Procfile"
28
+ on roles(:app) do |host|
29
+ upload! "tmp/Procfile_#{host.name}", "#{fetch(:deploy_to)}/current/Procfile"
30
30
  end
31
31
  end
32
32
 
@@ -34,9 +34,20 @@ namespace :deploy do
34
34
  task :generate_procfile do
35
35
  Dir.mkdir('tmp') unless Dir.exist?('tmp')
36
36
 
37
- File.open('tmp/Procfile', 'w') do |conf|
38
- fetch(:procfile_contents).each_line do |line|
39
- conf.puts "#{line.chomp} 2>&1 | logger -t #{fetch(:app_name)}"
37
+ procfile_contents = fetch(:procfile_contents)
38
+
39
+ on roles(:app) do |host|
40
+ procfile_contents_string =
41
+ if procfile_contents.is_a?(Hash)
42
+ procfile_contents.fetch(host.hostname)
43
+ else
44
+ procfile_contents
45
+ end
46
+
47
+ File.open("tmp/Procfile_#{host.hostname}", 'w') do |conf|
48
+ procfile_contents_string.each_line do |line|
49
+ conf.puts "#{line.chomp} 2>&1 | logger -t #{fetch(:app_name)}"
50
+ end
40
51
  end
41
52
  end
42
53
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-twingly
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Twingly AB