capistrano-twingly 2.4.0 → 4.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +24 -0
- data/CHANGELOG.md +39 -0
- data/README.md +6 -29
- data/capistrano-twingly.gemspec +3 -4
- data/lib/capistrano/twingly.rb +1 -1
- data/lib/capistrano/twingly/service.rb +1 -0
- data/lib/capistrano/twingly/tasks/nginx.rake +1 -2
- data/lib/capistrano/twingly/tasks/servers_from_srv_record.rake +0 -1
- data/lib/capistrano/twingly/tasks/service.rake +128 -0
- metadata +15 -30
- data/.travis.yml +0 -28
- data/lib/capistrano/twingly/tasks/upstart.rake +0 -58
- data/lib/capistrano/twingly/upstart.rb +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 000dcbd7e977d7e37ce27e2cd5f61278a835aa79febecf7dbb8edbd74fb8bf2b
|
4
|
+
data.tar.gz: 6954ff08beb258f8d0d3f598fd34652dc56c062b1070c1a8c396ee1bf68ac467
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d827b49fcf10fcec1f3d9127b27e026b3dc30327fa0406c0ae10714160e1ecd72c7accd00ea22629e9bc5d28eb7ce4ba4f4dfcd7b2028605a8b2a296c76b4a75
|
7
|
+
data.tar.gz: 5a97a343b609656ba2dabbd99d4d9536669e66131f4eda02374946b7a71f0a622736706e780f00e9b77c62cdf5d38a62087e40d1da187b92aed4a6b2a694cef9
|
@@ -0,0 +1,24 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on: push
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ubuntu-18.04
|
8
|
+
|
9
|
+
strategy:
|
10
|
+
matrix:
|
11
|
+
ruby: [2.7.1, head]
|
12
|
+
|
13
|
+
steps:
|
14
|
+
- name: Checkout Code
|
15
|
+
uses: actions/checkout@v2
|
16
|
+
|
17
|
+
- name: Setup Ruby ${{ matrix.ruby }}
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: ${{ matrix.ruby }}
|
21
|
+
bundler-cache: true
|
22
|
+
|
23
|
+
- name: Run
|
24
|
+
run: bundle exec rake
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,44 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [v4.0.1](https://github.com/twingly/capistrano-twingly/tree/v4.0.1) (2019-05-02)
|
4
|
+
[Full Changelog](https://github.com/twingly/capistrano-twingly/compare/v4.0.0...v4.0.1)
|
5
|
+
|
6
|
+
**Fixed bugs:**
|
7
|
+
|
8
|
+
- Initial deploy for systemd fails since \#47 [\#49](https://github.com/twingly/capistrano-twingly/issues/49)
|
9
|
+
|
10
|
+
**Merged pull requests:**
|
11
|
+
|
12
|
+
- Make sure systemd target is loaded before trying to stop it [\#50](https://github.com/twingly/capistrano-twingly/pull/50) ([roback](https://github.com/roback))
|
13
|
+
|
14
|
+
## [v4.0.0](https://github.com/twingly/capistrano-twingly/tree/v4.0.0) (2019-04-29)
|
15
|
+
[Full Changelog](https://github.com/twingly/capistrano-twingly/compare/v3.0.0...v4.0.0)
|
16
|
+
|
17
|
+
**Closed issues:**
|
18
|
+
|
19
|
+
- Add systemd support [\#45](https://github.com/twingly/capistrano-twingly/issues/45)
|
20
|
+
|
21
|
+
**Merged pull requests:**
|
22
|
+
|
23
|
+
- Generate systemd config in addition to upstart [\#47](https://github.com/twingly/capistrano-twingly/pull/47) ([roback](https://github.com/roback))
|
24
|
+
|
25
|
+
## [v3.0.0](https://github.com/twingly/capistrano-twingly/tree/v3.0.0) (2018-11-08)
|
26
|
+
[Full Changelog](https://github.com/twingly/capistrano-twingly/compare/v2.4.1...v3.0.0)
|
27
|
+
|
28
|
+
**Merged pull requests:**
|
29
|
+
|
30
|
+
- Remove LKP traces [\#44](https://github.com/twingly/capistrano-twingly/pull/44) ([walro](https://github.com/walro))
|
31
|
+
|
32
|
+
## [v2.4.1](https://github.com/twingly/capistrano-twingly/tree/v2.4.1) (2018-10-05)
|
33
|
+
[Full Changelog](https://github.com/twingly/capistrano-twingly/compare/v2.4.0...v2.4.1)
|
34
|
+
|
35
|
+
## [v2.4.0](https://github.com/twingly/capistrano-twingly/tree/v2.4.0) (2018-10-04)
|
36
|
+
[Full Changelog](https://github.com/twingly/capistrano-twingly/compare/v2.3.0...v2.4.0)
|
37
|
+
|
38
|
+
**Merged pull requests:**
|
39
|
+
|
40
|
+
- Each server can have different Procfiles [\#43](https://github.com/twingly/capistrano-twingly/pull/43) ([roback](https://github.com/roback))
|
41
|
+
|
3
42
|
## [v2.3.0](https://github.com/twingly/capistrano-twingly/tree/v2.3.0) (2018-10-04)
|
4
43
|
[Full Changelog](https://github.com/twingly/capistrano-twingly/compare/v2.2.0...v2.3.0)
|
5
44
|
|
data/README.md
CHANGED
@@ -45,7 +45,7 @@ require 'capistrano/twingly/nginx'
|
|
45
45
|
|
46
46
|
# config/deploy.rb
|
47
47
|
set :app_name, 'contest-bamba'
|
48
|
-
set :server_names, %w(bamba.bloggportalen.se)
|
48
|
+
set :server_names, %w(bamba.bloggportalen.se)
|
49
49
|
set :use_https, true # Optional
|
50
50
|
|
51
51
|
namespace :deploy do
|
@@ -56,11 +56,11 @@ namespace :deploy do
|
|
56
56
|
end
|
57
57
|
```
|
58
58
|
|
59
|
-
### Upstart
|
59
|
+
### Upstart/Systemd
|
60
60
|
|
61
61
|
```Ruby
|
62
62
|
# Capfile
|
63
|
-
require 'capistrano/twingly/
|
63
|
+
require 'capistrano/twingly/service'
|
64
64
|
|
65
65
|
# config/deploy.rb
|
66
66
|
set :procfile_contents, -> {
|
@@ -74,29 +74,6 @@ set :procfile_contents, -> {
|
|
74
74
|
}
|
75
75
|
|
76
76
|
namespace :deploy do
|
77
|
-
desc 'Start application'
|
78
|
-
task :start do
|
79
|
-
invoke 'deploy:export_upstart'
|
80
|
-
on roles(:app) do
|
81
|
-
sudo :start, fetch(:application)
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
desc 'Restart application'
|
86
|
-
task :restart do
|
87
|
-
invoke 'deploy:export_upstart'
|
88
|
-
on roles(:app) do
|
89
|
-
execute "sudo restart #{fetch(:application)} || sudo start #{fetch(:application)}"
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
desc 'Stop application'
|
94
|
-
task :stop do
|
95
|
-
on roles(:app) do
|
96
|
-
sudo :stop, fetch(:application)
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
77
|
after :stop, 'deploy:disable_autostart'
|
101
78
|
after :start, 'deploy:enable_autostart'
|
102
79
|
after :restart, 'deploy:enable_autostart'
|
@@ -148,13 +125,13 @@ end
|
|
148
125
|
|
149
126
|
* Bump the version in `capistrano-twingly.gemspec` in a commit, no need to push (the release task does that).
|
150
127
|
|
128
|
+
* Ensure you are signed in to RubyGems.org as [twingly][twingly-rubygems] with `gem signin`.
|
129
|
+
|
151
130
|
* Build and [publish](http://guides.rubygems.org/publishing/) the gem. This will create the proper tag in git, push the commit and tag and upload to RubyGems.
|
152
131
|
|
153
132
|
bundle exec rake release
|
154
133
|
|
155
|
-
|
156
|
-
|
157
|
-
* Update the changelog with [GitHub Changelog Generator](https://github.com/skywinder/github-changelog-generator/) (`gem install github_changelog_generator` if you don't have it, set `CHANGELOG_GITHUB_TOKEN` to a personal access token to avoid rate limiting by GitHub). This command will update `CHANGELOG.md`, commit and push manually.
|
134
|
+
* Update the changelog with [GitHub Changelog Generator](https://github.com/skywinder/github-changelog-generator/) (`gem install github_changelog_generator` if you don't have it, set `CHANGELOG_GITHUB_TOKEN` to a personal access token to avoid rate limiting by GitHub). This command will update `CHANGELOG.md`. You need to commit and push manually.
|
158
135
|
|
159
136
|
github_changelog_generator
|
160
137
|
|
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 = '
|
7
|
+
spec.version = '4.0.2'
|
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}
|
@@ -17,15 +17,14 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.add_dependency "capistrano", "~> 3.
|
21
|
-
spec.add_dependency "capistrano-bundler", "
|
20
|
+
spec.add_dependency "capistrano", "~> 3.14"
|
21
|
+
spec.add_dependency "capistrano-bundler", "~> 2.0"
|
22
22
|
spec.add_dependency "capistrano-chruby", "0.1.2"
|
23
23
|
spec.add_dependency "foreman", "~> 0.82"
|
24
24
|
spec.add_dependency "net-ssh", "~> 5.0"
|
25
25
|
spec.add_dependency "ed25519", ">= 1.2", "< 1.3"
|
26
26
|
spec.add_dependency "bcrypt_pbkdf", ">= 1.0", "< 2.0"
|
27
27
|
|
28
|
-
spec.add_development_dependency "bundler", "~> 1.5"
|
29
28
|
spec.add_development_dependency "rspec", "~> 3"
|
30
29
|
spec.add_development_dependency "rake"
|
31
30
|
end
|
data/lib/capistrano/twingly.rb
CHANGED
@@ -13,7 +13,7 @@ require "capistrano/bundler"
|
|
13
13
|
|
14
14
|
# Twingly tasks
|
15
15
|
require "capistrano/twingly/nginx"
|
16
|
-
require "capistrano/twingly/
|
16
|
+
require "capistrano/twingly/service"
|
17
17
|
require "capistrano/twingly/tag_deploy_in_git"
|
18
18
|
require "capistrano/twingly/current_git_branch"
|
19
19
|
require "capistrano/twingly/servers_from_srv_record"
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path("../tasks/service.rake", __FILE__)
|
@@ -6,8 +6,7 @@ namespace :deploy do
|
|
6
6
|
|
7
7
|
app_dir = fetch(:deploy_to)
|
8
8
|
app_name = fetch(:app_name)
|
9
|
-
server_names =
|
10
|
-
server_names << "#{app_name}.live.lkp.primelabs.se"
|
9
|
+
server_names = fetch(:server_names)
|
11
10
|
|
12
11
|
https_port = ":443" if fetch(:use_https)
|
13
12
|
|
@@ -0,0 +1,128 @@
|
|
1
|
+
namespace :deploy do
|
2
|
+
desc 'Lookup which service manager is used on each server'
|
3
|
+
task :lookup_server_service_manager do
|
4
|
+
init_system_pid = 1
|
5
|
+
|
6
|
+
on roles(:app) do |host|
|
7
|
+
service_manager_name =
|
8
|
+
capture "ps -p#{init_system_pid} co command | grep systemd || echo upstart"
|
9
|
+
|
10
|
+
server(host).add_role(service_manager_name.to_sym)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
desc 'Export service script'
|
15
|
+
task export_service: %w[lookup_server_service_manager foreman:upload_procfile] do
|
16
|
+
set :bundle_binstubs, -> { shared_path.join('bin') }
|
17
|
+
|
18
|
+
on roles(:upstart) do
|
19
|
+
within current_path do
|
20
|
+
sudo fetch(:chruby_exec), "#{fetch(:chruby_ruby)} -- #{fetch(:bundle_binstubs)}/foreman export upstart /etc/init -a #{fetch(:application)} -u \`whoami\` -l #{shared_path}/log"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
on roles(:systemd) do
|
25
|
+
load_state =
|
26
|
+
capture "systemctl show #{fetch(:application)}.target -p LoadState --value"
|
27
|
+
|
28
|
+
if load_state == "loaded"
|
29
|
+
sudo :systemctl, "stop #{fetch(:application)}.target"
|
30
|
+
end
|
31
|
+
|
32
|
+
within current_path do
|
33
|
+
sudo fetch(:chruby_exec), "#{fetch(:chruby_ruby)} -- #{fetch(:bundle_binstubs)}/foreman export systemd /etc/systemd/system -a #{fetch(:application)} -u \`whoami\` -l #{shared_path}/log"
|
34
|
+
end
|
35
|
+
|
36
|
+
sudo :systemctl, "daemon-reload"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
desc "Start application"
|
41
|
+
task start: :lookup_server_service_manager do
|
42
|
+
invoke "deploy:export_service"
|
43
|
+
|
44
|
+
on roles(:upstart) do
|
45
|
+
sudo :start, fetch(:application)
|
46
|
+
end
|
47
|
+
|
48
|
+
on roles(:systemd) do
|
49
|
+
sudo :systemctl, "start #{fetch(:application)}.target"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
desc "Restart application"
|
54
|
+
task restart: :lookup_server_service_manager do
|
55
|
+
invoke "deploy:export_service"
|
56
|
+
|
57
|
+
on roles(:upstart) do
|
58
|
+
execute "sudo restart #{fetch(:application)} || sudo start #{fetch(:application)}"
|
59
|
+
end
|
60
|
+
|
61
|
+
on roles(:systemd) do
|
62
|
+
application = fetch(:application)
|
63
|
+
execute "sudo systemctl restart #{application}.target || sudo systemctl start #{application}.target"
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
desc "Stop application"
|
68
|
+
task stop: :lookup_server_service_manager do
|
69
|
+
on roles(:upstart) do
|
70
|
+
sudo :stop, fetch(:application)
|
71
|
+
end
|
72
|
+
|
73
|
+
on roles(:systemd) do
|
74
|
+
sudo :systemctl, "stop #{fetch(:application)}.target"
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
task disable_autostart: :lookup_server_service_manager do
|
79
|
+
on roles(:upstart) do
|
80
|
+
execute "/bin/echo manual | sudo /usr/bin/tee /etc/init/#{fetch(:application)}.override"
|
81
|
+
end
|
82
|
+
|
83
|
+
on roles(:systemd) do
|
84
|
+
sudo :systemctl, "disable #{fetch(:application)}.target"
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
task enable_autostart: :lookup_server_service_manager do
|
89
|
+
on roles(:upstart) do
|
90
|
+
execute "/bin/echo | sudo /usr/bin/tee /etc/init/#{fetch(:application)}.override"
|
91
|
+
end
|
92
|
+
|
93
|
+
on roles(:systemd) do
|
94
|
+
sudo :systemctl, "enable #{fetch(:application)}.target"
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
namespace :foreman do
|
99
|
+
desc 'Upload Procfile to server'
|
100
|
+
task upload_procfile: :generate_procfile do
|
101
|
+
on roles(:app) do |host|
|
102
|
+
upload! "tmp/Procfile_#{host.hostname}", "#{fetch(:deploy_to)}/current/Procfile"
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
desc 'Generate Procfile'
|
107
|
+
task :generate_procfile do
|
108
|
+
Dir.mkdir('tmp') unless Dir.exist?('tmp')
|
109
|
+
|
110
|
+
procfile_contents = fetch(:procfile_contents)
|
111
|
+
|
112
|
+
on roles(:app) do |host|
|
113
|
+
procfile_contents_string =
|
114
|
+
if procfile_contents.is_a?(Hash)
|
115
|
+
procfile_contents.fetch(host.hostname)
|
116
|
+
else
|
117
|
+
procfile_contents
|
118
|
+
end
|
119
|
+
|
120
|
+
File.open("tmp/Procfile_#{host.hostname}", 'w') do |conf|
|
121
|
+
procfile_contents_string.each_line do |line|
|
122
|
+
conf.puts "#{line.chomp} 2>&1 | logger -t #{fetch(:app_name)}"
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-twingly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Twingly AB
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.
|
19
|
+
version: '3.14'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.
|
26
|
+
version: '3.14'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: capistrano-bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '2.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '2.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: capistrano-chruby
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,20 +120,6 @@ dependencies:
|
|
120
120
|
- - "<"
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '2.0'
|
123
|
-
- !ruby/object:Gem::Dependency
|
124
|
-
name: bundler
|
125
|
-
requirement: !ruby/object:Gem::Requirement
|
126
|
-
requirements:
|
127
|
-
- - "~>"
|
128
|
-
- !ruby/object:Gem::Version
|
129
|
-
version: '1.5'
|
130
|
-
type: :development
|
131
|
-
prerelease: false
|
132
|
-
version_requirements: !ruby/object:Gem::Requirement
|
133
|
-
requirements:
|
134
|
-
- - "~>"
|
135
|
-
- !ruby/object:Gem::Version
|
136
|
-
version: '1.5'
|
137
123
|
- !ruby/object:Gem::Dependency
|
138
124
|
name: rspec
|
139
125
|
requirement: !ruby/object:Gem::Requirement
|
@@ -169,9 +155,9 @@ executables: []
|
|
169
155
|
extensions: []
|
170
156
|
extra_rdoc_files: []
|
171
157
|
files:
|
158
|
+
- ".github/workflows/ci.yml"
|
172
159
|
- ".gitignore"
|
173
160
|
- ".rspec"
|
174
|
-
- ".travis.yml"
|
175
161
|
- CHANGELOG.md
|
176
162
|
- Gemfile
|
177
163
|
- LICENSE.txt
|
@@ -182,19 +168,19 @@ files:
|
|
182
168
|
- lib/capistrano/twingly/current_git_branch.rb
|
183
169
|
- lib/capistrano/twingly/nginx.rb
|
184
170
|
- lib/capistrano/twingly/servers_from_srv_record.rb
|
171
|
+
- lib/capistrano/twingly/service.rb
|
185
172
|
- lib/capistrano/twingly/tag_deploy_in_git.rb
|
186
173
|
- lib/capistrano/twingly/tasks/current_git_branch.rake
|
187
174
|
- lib/capistrano/twingly/tasks/nginx.rake
|
188
175
|
- lib/capistrano/twingly/tasks/servers_from_srv_record.rake
|
176
|
+
- lib/capistrano/twingly/tasks/service.rake
|
189
177
|
- lib/capistrano/twingly/tasks/tag_deploy_in_git.rake
|
190
|
-
- lib/capistrano/twingly/tasks/upstart.rake
|
191
|
-
- lib/capistrano/twingly/upstart.rb
|
192
178
|
- spec/integration/net_ssh_spec.rb
|
193
179
|
homepage: https://github.com/twingly/capistrano-twingly
|
194
180
|
licenses:
|
195
181
|
- MIT
|
196
182
|
metadata: {}
|
197
|
-
post_install_message:
|
183
|
+
post_install_message:
|
198
184
|
rdoc_options: []
|
199
185
|
require_paths:
|
200
186
|
- lib
|
@@ -209,9 +195,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
195
|
- !ruby/object:Gem::Version
|
210
196
|
version: '0'
|
211
197
|
requirements: []
|
212
|
-
|
213
|
-
|
214
|
-
signing_key:
|
198
|
+
rubygems_version: 3.1.4
|
199
|
+
signing_key:
|
215
200
|
specification_version: 4
|
216
201
|
summary: Capistrano 3 tasks used for Twingly's Ruby deployment
|
217
202
|
test_files:
|
data/.travis.yml
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
sudo: false
|
3
|
-
|
4
|
-
rvm:
|
5
|
-
- 2.4.2
|
6
|
-
- ruby-head
|
7
|
-
|
8
|
-
matrix:
|
9
|
-
allow_failures:
|
10
|
-
- rvm: ruby-head
|
11
|
-
fast_finish: true
|
12
|
-
|
13
|
-
before_install:
|
14
|
-
- gem install bundler
|
15
|
-
|
16
|
-
cache: bundler
|
17
|
-
|
18
|
-
notifications:
|
19
|
-
email: false
|
20
|
-
hipchat:
|
21
|
-
rooms:
|
22
|
-
secure: "ILGWgc1QgHVRhwxWgYo+DxLySgOPdwahOV8py1dlRhi4juRUvMcMJSFYvTS47T1Mm8JSJXGaJtEcz24YgWF4XQsL2OawntdxJDNuzmFhF0fC+syN3qHXVzaRIplfcbGOj5rW4Uga8HumvvrQl/g5fscgsGM02BAOKgJhRPM7YLY="
|
23
|
-
on_success: never
|
24
|
-
on_failure: change
|
25
|
-
template:
|
26
|
-
- '%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message}
|
27
|
-
(<a href="%{build_url}">Details</a>/<a href="%{compare_url}">Change view</a>)'
|
28
|
-
format: html
|
@@ -1,58 +0,0 @@
|
|
1
|
-
namespace :deploy do
|
2
|
-
set :bundle_binstubs, -> { shared_path.join('bin') }
|
3
|
-
|
4
|
-
desc 'Export upstart script'
|
5
|
-
task :export_upstart do
|
6
|
-
on roles(:app) do
|
7
|
-
within current_path do
|
8
|
-
sudo fetch(:chruby_exec), "#{fetch(:chruby_ruby)} -- #{fetch(:bundle_binstubs)}/foreman export upstart /etc/init -a #{fetch(:application)} -u \`whoami\` -l #{shared_path}/log"
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
task :disable_autostart do
|
14
|
-
on roles(:app) do
|
15
|
-
execute "/bin/echo manual | sudo /usr/bin/tee /etc/init/#{fetch(:application)}.override"
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
task :enable_autostart do
|
20
|
-
on roles(:app) do
|
21
|
-
execute "/bin/echo | sudo /usr/bin/tee /etc/init/#{fetch(:application)}.override"
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
namespace :foreman do
|
26
|
-
desc 'Upload Procfile to server'
|
27
|
-
task :upload_procfile do
|
28
|
-
on roles(:app) do |host|
|
29
|
-
upload! "tmp/Procfile_#{host.name}", "#{fetch(:deploy_to)}/current/Procfile"
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
desc 'Generate Procfile'
|
34
|
-
task :generate_procfile do
|
35
|
-
Dir.mkdir('tmp') unless Dir.exist?('tmp')
|
36
|
-
|
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
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
before 'deploy:export_upstart', 'deploy:foreman:upload_procfile'
|
57
|
-
before 'deploy:foreman:upload_procfile', 'deploy:foreman:generate_procfile'
|
58
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
load File.expand_path("../tasks/upstart.rake", __FILE__)
|