groundskeeper-bitcore 0.13.0 → 0.18.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/.rubocop.yml +3 -0
- data/.ruby-version +1 -1
- data/README.md +3 -2
- data/bitbucket-pipelines.yml +1 -1
- data/config/git_config.rb +2 -0
- data/config/predeploy.rb +26 -5
- data/config/rails_config.rb.erb +1 -1
- data/config/vhost_config_nginx.conf.erb +26 -0
- data/groundskeeper.gemspec +2 -2
- data/lib/groundskeeper/application.rb +1 -0
- data/lib/groundskeeper/commands.rb +27 -14
- data/lib/groundskeeper/project.rb +7 -0
- data/lib/groundskeeper/version.rb +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8aba462cf19e6cba7461724cdd192f643f0d174f4d6ae3f078759ac21103cb18
|
4
|
+
data.tar.gz: 5586ffa52b9576701b6839166d951bdb9524d46252427b89d6858b0ab0eb2341
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9dd9e1d9c8b91e8313dfc40e127a5630c2b0f048206dee4dad900f2c60c443afed3617679e47622d9c29035dbbc52436c25f8427c2ae5cb849b055dedc191b60
|
7
|
+
data.tar.gz: 5de0587c1b110b9a0a4bb5ffa3f475c2ba5a08f8ff68077a24a9ff5a4db77e873316c83ababd9c0b5c547c41ca4ca02060ec72c271ced41fb966d9b7ddf0d9e5
|
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7.1
|
data/README.md
CHANGED
@@ -70,10 +70,11 @@ application directory:
|
|
70
70
|
ground release
|
71
71
|
```
|
72
72
|
|
73
|
-
To prepare the server (only required the first time) for deployment
|
73
|
+
To prepare the server (only required the first time) for deployment, add nginx
|
74
|
+
flag if deploying to nginx server:
|
74
75
|
|
75
76
|
```bash
|
76
|
-
tag=0.0.0 stage=production ground predeploy
|
77
|
+
tag=0.0.0 stage=production ground predeploy [--nginx]
|
77
78
|
```
|
78
79
|
|
79
80
|
To deploy the release (note that `stage` is optional and will be set to staging
|
data/bitbucket-pipelines.yml
CHANGED
data/config/git_config.rb
CHANGED
@@ -25,6 +25,7 @@ task :before_run do
|
|
25
25
|
set :deploy_to, project.deploy_to
|
26
26
|
set :forward_agent, true
|
27
27
|
set :bundle_path, "bundle"
|
28
|
+
set :smtp_domain, project.smtp_domain
|
28
29
|
|
29
30
|
set :rvm_ruby_version, project.rvm_ruby_version
|
30
31
|
set :rvm_type, :system
|
@@ -41,5 +42,6 @@ task :before_run do
|
|
41
42
|
|
42
43
|
set :branch, "master"
|
43
44
|
set :tag, tag
|
45
|
+
set :nginx, fetch(:nginx)
|
44
46
|
end
|
45
47
|
# rubocop:enable Metrics/BlockLength
|
data/config/predeploy.rb
CHANGED
@@ -28,6 +28,14 @@ def vhost_config_file
|
|
28
28
|
"/etc/httpd/conf.d/#{fetch :application_name}.conf"
|
29
29
|
end
|
30
30
|
|
31
|
+
def vhost_nginx_config_file
|
32
|
+
"/etc/nginx/sites-available/#{fetch :application_name}.conf"
|
33
|
+
end
|
34
|
+
|
35
|
+
def vhost_nginx_linked_file
|
36
|
+
"/etc/nginx/sites-enabled/#{fetch :application_name}.conf"
|
37
|
+
end
|
38
|
+
|
31
39
|
def remote_shared_path(path)
|
32
40
|
"#{fetch(:user)}@#{fetch(:domain)}:#{fetch(:shared_path)}/#{path}"
|
33
41
|
end
|
@@ -101,14 +109,25 @@ namespace :deploy_configure do
|
|
101
109
|
end
|
102
110
|
# rubocop:enable Metrics/BlockLength
|
103
111
|
|
112
|
+
# rubocop:disable Metrics/BlockLength
|
104
113
|
namespace :deploy_prepare do
|
105
114
|
desc "Write the virtual host config file. May require an Apache restart."
|
106
115
|
task :create_vhost do
|
107
116
|
load_project
|
117
|
+
vhost_file = vhost_config_file
|
108
118
|
vhost_config = load_template("vhost_config.conf.erb")
|
109
|
-
|
110
|
-
|
111
|
-
|
119
|
+
|
120
|
+
if fetch(:nginx)
|
121
|
+
vhost_file = vhost_nginx_config_file
|
122
|
+
vhost_config = load_template("vhost_config_nginx.conf.erb")
|
123
|
+
command "sudo chown -R deploy:nginx /etc/nginx/sites-available"
|
124
|
+
command "sudo chown -R deploy:nginx /etc/nginx/sites-enabled"
|
125
|
+
end
|
126
|
+
|
127
|
+
if !(File.exist? vhost_file) || FORCE_OVERWRITE
|
128
|
+
comment "Writing virtual host config to #{vhost_file}"
|
129
|
+
command "echo \"#{vhost_config}\" > #{vhost_file}"
|
130
|
+
command "ln -s #{vhost_file} #{vhost_nginx_linked_file}" if fetch(:nginx)
|
112
131
|
end
|
113
132
|
end
|
114
133
|
|
@@ -120,7 +139,9 @@ namespace :deploy_prepare do
|
|
120
139
|
|
121
140
|
desc "Set owner."
|
122
141
|
task :set_owner do
|
123
|
-
|
124
|
-
|
142
|
+
owner = fetch(:nginx) ? "nginx" : "apache"
|
143
|
+
comment "Setting owner of #{fetch :deploy_to} #{owner}"
|
144
|
+
command "sudo chgrp -R #{owner} #{fetch :deploy_to}"
|
125
145
|
end
|
126
146
|
end
|
147
|
+
# rubocop:enable Metrics/BlockLength
|
data/config/rails_config.rb.erb
CHANGED
@@ -64,7 +64,7 @@ Rails.application.configure do
|
|
64
64
|
authentication: :plain,
|
65
65
|
address: 'smtp.mailgun.org',
|
66
66
|
port: 587,
|
67
|
-
domain: '
|
67
|
+
domain: '<%= fetch :smtp_domain %>',
|
68
68
|
user_name: ENV['mailgun_db_username'],
|
69
69
|
password: ENV['mailgun_db_password']
|
70
70
|
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<% project = fetch :project -%>
|
2
|
+
server {
|
3
|
+
listen 80;
|
4
|
+
|
5
|
+
server_name <%= fetch :domain %>;
|
6
|
+
return 301 https://<%= fetch :domain -%>/;
|
7
|
+
}
|
8
|
+
|
9
|
+
server {
|
10
|
+
listen 443 ssl;
|
11
|
+
server_name <%= fetch :domain %>;
|
12
|
+
|
13
|
+
passenger_enabled on;
|
14
|
+
passenger_friendly_error_pages off;
|
15
|
+
passenger_app_env <%= fetch :stage %>;
|
16
|
+
passenger_ruby /usr/local/rvm/gems/ruby-<%= fetch :rvm_ruby_version -%>/wrappers/ruby;
|
17
|
+
passenger_min_instances 1;
|
18
|
+
passenger_base_uri /;
|
19
|
+
|
20
|
+
root <%= fetch :deploy_to -%>/current/public;
|
21
|
+
|
22
|
+
ssl_certificate <%= project.ssl_certificate_file(fetch(:stage).to_sym) %>;
|
23
|
+
ssl_certificate_key <%= project.ssl_certificate_key_file(fetch(:stage).to_sym) %>;
|
24
|
+
ssl_protocols TLSv1.2;
|
25
|
+
ssl_ciphers HIGH:!aNULL:!MD5;
|
26
|
+
}
|
data/groundskeeper.gemspec
CHANGED
@@ -31,10 +31,10 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.executables = "ground"
|
32
32
|
spec.require_paths = %w[lib config]
|
33
33
|
|
34
|
-
spec.add_dependency "jira-ruby", "~>
|
34
|
+
spec.add_dependency "jira-ruby", "~> 2.0"
|
35
35
|
spec.add_dependency "mina", "~> 1.2"
|
36
36
|
spec.add_dependency "mina-whenever", "~> 1.0.1"
|
37
|
-
spec.add_dependency "thor", "~> 0
|
37
|
+
spec.add_dependency "thor", "~> 1.0"
|
38
38
|
|
39
39
|
spec.add_development_dependency "bundler", "~> 2.0"
|
40
40
|
spec.add_development_dependency "byebug"
|
@@ -5,6 +5,8 @@ require "mina"
|
|
5
5
|
require "pp"
|
6
6
|
require "open3"
|
7
7
|
|
8
|
+
class VersionError < StandardError; end
|
9
|
+
|
8
10
|
module Groundskeeper
|
9
11
|
# Formulas for managing releases and deployments.
|
10
12
|
# rubocop:disable Metrics/ClassLength
|
@@ -191,6 +193,7 @@ module Groundskeeper
|
|
191
193
|
cmd << " -s" if options[:simulate]
|
192
194
|
cmd << " -v" if options[:verbose]
|
193
195
|
cmd << " force_asset_precompile=true" if options[:force_asset_precompile]
|
196
|
+
cmd << " nginx=true" if options[:nginx]
|
194
197
|
run_mina cmd
|
195
198
|
end
|
196
199
|
|
@@ -209,16 +212,18 @@ module Groundskeeper
|
|
209
212
|
:bold)
|
210
213
|
latest_version = rubygems.latest_groundskeeper_version
|
211
214
|
|
212
|
-
|
213
|
-
console.say(
|
214
|
-
"Groundskeeper is outdated, please install #{latest_version}",
|
215
|
-
:red
|
216
|
-
)
|
215
|
+
return true unless SemanticVersion.new(latest_version) > VERSION
|
217
216
|
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
217
|
+
question = <<~TEXT.squish
|
218
|
+
Groundskeeper is outdated,
|
219
|
+
would you like the latest version installed?
|
220
|
+
TEXT
|
221
|
+
|
222
|
+
response = console.ask(question, :red, limited_to: %w[yes no])
|
223
|
+
|
224
|
+
return true if response == "no"
|
225
|
+
|
226
|
+
console.run("gem install groundskeeper-bitcore")
|
222
227
|
end
|
223
228
|
end
|
224
229
|
# rubocop:enable Metrics/MethodLength
|
@@ -372,18 +377,26 @@ module Groundskeeper
|
|
372
377
|
end
|
373
378
|
end
|
374
379
|
|
375
|
-
# rubocop:disable Metrics/MethodLength
|
380
|
+
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
376
381
|
def update_deployed_issues
|
382
|
+
tries = 0
|
383
|
+
|
377
384
|
announce_step(
|
378
385
|
"Check deployed version at #{website.uri}/#{Website::VERSION_PATH}"
|
379
386
|
)
|
380
|
-
deployed_version = website.version
|
381
387
|
|
382
|
-
|
388
|
+
begin
|
389
|
+
deployed_version = website.version
|
390
|
+
|
391
|
+
raise VersionError unless deployed_version == ENV[TAG]
|
392
|
+
|
383
393
|
console.say("# deployment successful", :green)
|
384
394
|
transition_remote_issues deployed_version
|
385
395
|
announce_in_slack deployed_version
|
386
|
-
|
396
|
+
rescue VersionError
|
397
|
+
tries += 1
|
398
|
+
sleep 5
|
399
|
+
retry if tries < 3
|
387
400
|
# :nocov:
|
388
401
|
console.say(
|
389
402
|
"something went wrong: expected version #{ENV[TAG]}, " \
|
@@ -393,7 +406,7 @@ module Groundskeeper
|
|
393
406
|
# :nocov:
|
394
407
|
end
|
395
408
|
end
|
396
|
-
# rubocop:enable Metrics/MethodLength
|
409
|
+
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize
|
397
410
|
|
398
411
|
# :nocov:
|
399
412
|
def release_version
|
@@ -17,6 +17,7 @@ module Groundskeeper
|
|
17
17
|
DB_ENV_VARIABLES_KEY = "db_env_variables"
|
18
18
|
SENTRY_DSN_KEY = "sentry_dsn"
|
19
19
|
SENTRY_PROJECT_KEY = "sentry_project"
|
20
|
+
SMTP_DOMAIN = "smtp_domain"
|
20
21
|
SSL_CERTIFICATE_FILE_KEY = "SSLCertificateFile"
|
21
22
|
SSL_CERTIFICATE_CHAIN_FILE_KEY = "SSLCertificateChainFile"
|
22
23
|
SSL_CERTIFICATE_KEY_FILE_KEY = "SSLCertificateKeyFile"
|
@@ -65,6 +66,12 @@ module Groundskeeper
|
|
65
66
|
end
|
66
67
|
# :nocov:
|
67
68
|
|
69
|
+
# :nocov:
|
70
|
+
def smtp_domain
|
71
|
+
details[SMTP_DOMAIN] || ""
|
72
|
+
end
|
73
|
+
# :nocov:
|
74
|
+
|
68
75
|
# :nocov:
|
69
76
|
def rvm_ruby_version
|
70
77
|
details[RVM_RUBY_VERSION_KEY] || ""
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: groundskeeper-bitcore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BIT Core
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain:
|
11
11
|
- certs/ericcf.pem
|
12
|
-
date:
|
12
|
+
date: 2020-06-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jira-ruby
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '2.0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '2.0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: mina
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,14 +59,14 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '0
|
62
|
+
version: '1.0'
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '0
|
69
|
+
version: '1.0'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: bundler
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -181,6 +181,7 @@ files:
|
|
181
181
|
- config/secrets_config.yml.erb
|
182
182
|
- config/tasks.rb
|
183
183
|
- config/vhost_config.conf.erb
|
184
|
+
- config/vhost_config_nginx.conf.erb
|
184
185
|
- groundskeeper.gemspec
|
185
186
|
- lib/groundskeeper.rb
|
186
187
|
- lib/groundskeeper/application.rb
|
@@ -223,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
223
224
|
- !ruby/object:Gem::Version
|
224
225
|
version: '0'
|
225
226
|
requirements: []
|
226
|
-
rubygems_version: 3.
|
227
|
+
rubygems_version: 3.1.2
|
227
228
|
signing_key:
|
228
229
|
specification_version: 4
|
229
230
|
summary: A gem for managing releases and deployments.
|