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 +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +15 -0
- data/capistrano-twingly.gemspec +1 -1
- data/lib/capistrano/twingly/tasks/upstart.rake +16 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75fa4a0261e7641d6b29921d6dcfe7615790f703e6393e92d57147eb21a163c4
|
4
|
+
data.tar.gz: 00f98265254260053e4fe778f3dfd9df8d442d293a527c06bedcab2fb4d9d004
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/capistrano-twingly.gemspec
CHANGED
@@ -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.
|
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!
|
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
|
-
|
38
|
-
|
39
|
-
|
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
|