groundskeeper-bitcore 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/config/deploy.rb +1 -1
- data/config/rails_config.rb.erb +63 -64
- data/config/vhost_config.conf.erb +44 -44
- data/lib/groundskeeper/commands.rb +23 -5
- data/lib/groundskeeper/git_hub.rb +5 -0
- data/lib/groundskeeper/project.rb +1 -8
- data/lib/groundskeeper/sentry.rb +6 -0
- data/lib/groundskeeper/version.rb +1 -1
- metadata +2 -3
- data/servers.yml +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5226b29a0e4aca883b307266416d0e2fe9a03418
|
4
|
+
data.tar.gz: d2389f396c568033925b7ecab7d858239a518924
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73c185b483f7ef22a19904c79c58cd9d7ff5681fc5c29987c85014bf32a31cfdf0a770cbc23eede4ccd8285df8ce26f1a88b4e323f404ce096064a84a6f18c71
|
7
|
+
data.tar.gz: f38b7f11652c93e865decd469f0f879c83caf67793ca8a41244d950025a9135aa783d6206a59361e840f99652d8cc6f62c27e68d9acf43519a2d1f26fbbfd532
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.3.4 - 2019-01-04
|
4
|
+
|
5
|
+
* GROUN-21 format virtual host and Rails config files nicely (#88)
|
6
|
+
* GROUN-22 Move mina whenever command to launch block of deploy (#87)
|
7
|
+
* GROUN-16 consolidate sentry public/private keys (#86)
|
8
|
+
* GROUN-19 move servers configuration to project_details (#85)
|
9
|
+
* GROUN-9 should warn about any missing environment variables or executables (#84)
|
10
|
+
|
3
11
|
## 0.3.3 - 2018-11-16
|
4
12
|
|
5
13
|
* GROUN-17 should mark versions released in Jira after deploying to production (#83)
|
data/config/deploy.rb
CHANGED
@@ -103,10 +103,10 @@ task deploy: :remote_environment do
|
|
103
103
|
invoke :'bundle:install'
|
104
104
|
invoke :'rails:db_migrate'
|
105
105
|
invoke :'rails:assets_precompile'
|
106
|
-
invoke(:'whenever:update') if ENV["whenever"]
|
107
106
|
invoke :'deploy:cleanup'
|
108
107
|
|
109
108
|
on :launch do
|
109
|
+
invoke(:'whenever:update') if ENV["whenever"]
|
110
110
|
invoke :restart
|
111
111
|
end
|
112
112
|
end
|
data/config/rails_config.rb.erb
CHANGED
@@ -1,88 +1,87 @@
|
|
1
1
|
<% project = fetch :project %>
|
2
2
|
Rails.application.configure do
|
3
|
-
|
4
|
-
|
5
|
-
config.sentry_public_dsn = '<%= project.sentry_public_dsn %>'
|
3
|
+
# For catching exceptions
|
4
|
+
config.sentry_dsn = '<%= project.sentry_dsn %>'
|
6
5
|
|
7
|
-
|
6
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
8
7
|
|
9
|
-
|
10
|
-
|
8
|
+
# Code is not reloaded between requests.
|
9
|
+
config.cache_classes = true
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
# Eager load code on boot. This eager loads most of Rails and
|
12
|
+
# your application in memory, allowing both thread web servers
|
13
|
+
# and those relying on copy on write to perform better.
|
14
|
+
# Rake tasks automatically ignore this option for performance.
|
15
|
+
config.eager_load = true
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
# Full error reports are disabled and caching is turned on.
|
18
|
+
config.consider_all_requests_local = false
|
19
|
+
config.action_controller.perform_caching = true
|
21
20
|
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
# Disable serving static files from the `/public` folder by default since
|
22
|
+
# Apache or NGINX already handles this.
|
23
|
+
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
25
24
|
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
# Compress JavaScripts and CSS.
|
26
|
+
config.assets.js_compressor = :uglifier
|
27
|
+
# config.assets.css_compressor = :sass
|
29
28
|
|
30
|
-
|
31
|
-
|
29
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
30
|
+
config.assets.compile = false
|
32
31
|
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
# Specifies the header that your server uses for sending files.
|
33
|
+
config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for apache
|
34
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
36
35
|
|
37
|
-
|
38
|
-
|
36
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
37
|
+
config.force_ssl = true
|
39
38
|
|
40
|
-
|
41
|
-
|
39
|
+
# Set to :debug to see everything in the log.
|
40
|
+
config.log_level = :info
|
42
41
|
|
43
|
-
|
44
|
-
|
42
|
+
# Prepend all log lines with the following tags.
|
43
|
+
config.log_tags = [ :request_id ]
|
45
44
|
|
46
|
-
|
47
|
-
|
45
|
+
# Use a different logger for distributed setups.
|
46
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
48
47
|
|
49
|
-
|
50
|
-
|
48
|
+
# Use a different cache store in production.
|
49
|
+
# config.cache_store = :mem_cache_store
|
51
50
|
|
52
|
-
|
51
|
+
config.action_mailer.perform_caching = false
|
53
52
|
|
54
|
-
|
55
|
-
|
56
|
-
|
53
|
+
# Precompile additional assets.
|
54
|
+
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
55
|
+
# config.assets.precompile += %w( search.js )
|
57
56
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
57
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
58
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
59
|
+
config.action_mailer.default_url_options = { host: '<%= fetch :domain %>' }
|
60
|
+
config.action_mailer.delivery_method = :smtp
|
61
|
+
config.action_mailer.raise_delivery_errors = false
|
62
|
+
config.action_mailer.perform_deliveries = true
|
63
|
+
config.action_mailer.smtp_settings = {
|
64
|
+
authentication: :plain,
|
65
|
+
address: 'smtp.mailgun.org',
|
66
|
+
port: 587,
|
67
|
+
domain: 'cbits.northwestern.edu',
|
68
|
+
user_name: ENV['mailgun_db_username'],
|
69
|
+
password: ENV['mailgun_db_password']
|
70
|
+
}
|
72
71
|
|
73
|
-
|
74
|
-
|
72
|
+
Rails.application.routes.default_url_options[:host] = '<%= fetch :domain %>'
|
73
|
+
Rails.application.routes.default_url_options[:protocol] = 'https'
|
75
74
|
|
76
|
-
|
77
|
-
|
78
|
-
|
75
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
76
|
+
# the I18n.default_locale when a translation can not be found).
|
77
|
+
config.i18n.fallbacks = true
|
79
78
|
|
80
|
-
|
81
|
-
|
79
|
+
# Send deprecation notices to registered listeners.
|
80
|
+
config.active_support.deprecation = :notify
|
82
81
|
|
83
|
-
|
84
|
-
|
82
|
+
# Disable automatic flushing of the log to improve performance.
|
83
|
+
# config.autoflush_log = false
|
85
84
|
|
86
|
-
|
87
|
-
|
85
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
86
|
+
config.log_formatter = ::Logger::Formatter.new
|
88
87
|
end
|
@@ -1,49 +1,49 @@
|
|
1
1
|
<% project = fetch :project -%>
|
2
2
|
<VirtualHost *:80>
|
3
|
-
|
4
|
-
|
5
|
-
</VirtualHost>
|
6
|
-
|
7
|
-
<VirtualHost *:443>
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
</VirtualHost>
|
3
|
+
ServerName <%= fetch :domain %>
|
4
|
+
Redirect permanent / https://<%= fetch :domain -%>/
|
5
|
+
</VirtualHost>
|
6
|
+
|
7
|
+
<VirtualHost *:443>
|
8
|
+
PassengerFriendlyErrorPages off
|
9
|
+
PassengerAppEnv <%= fetch :stage %>
|
10
|
+
PassengerRuby /usr/local/rvm/wrappers/ruby-<%= fetch :rvm_ruby_version -%>/ruby
|
11
|
+
# Always have at least 1 process in existence for the application
|
12
|
+
PassengerMinInstances 1
|
13
|
+
|
14
|
+
ServerName <%= fetch :domain %>
|
15
|
+
|
16
|
+
SSLEngine On
|
17
|
+
SSLCertificateFile <%= project.ssl_certificate_file(fetch(:stage).to_sym) %>
|
18
|
+
SSLCertificateChainFile <%= project.ssl_certificate_chain_file(fetch(:stage).to_sym) %>
|
19
|
+
SSLCertificateKeyFile <%= project.ssl_certificate_key_file(fetch(:stage).to_sym) %>
|
20
|
+
|
21
|
+
DocumentRoot <%= fetch :deploy_to -%>/current/public
|
22
|
+
RailsBaseURI /
|
23
|
+
PassengerDebugLogFile /var/log/httpd/passenger.log
|
24
|
+
|
25
|
+
<Directory <%= fetch :deploy_to -%>/current/public >
|
26
|
+
Allow from all
|
27
|
+
Options -MultiViews
|
28
|
+
</Directory>
|
29
|
+
|
30
|
+
AddOutputFilterByType DEFLATE text/html text/css application/javascript
|
31
|
+
|
32
|
+
RewriteEngine On
|
33
|
+
|
34
|
+
# Show maintenance page if it exists
|
35
|
+
ErrorDocument 503 /system/maintenance.html
|
36
|
+
RewriteCond %{REQUEST_URI} !\.(css|gif|jpg|png)$
|
37
|
+
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
|
38
|
+
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
|
39
|
+
RewriteRule ^.*$ - [redirect=503,last]
|
40
|
+
|
41
|
+
<Location /assets/>
|
42
|
+
# RFC says only cache for 1 year
|
43
|
+
ExpiresActive On
|
44
|
+
ExpiresDefault \"access plus 1 year\"
|
45
|
+
</Location>
|
46
|
+
</VirtualHost>
|
47
47
|
|
48
48
|
# Start the application before the first access
|
49
49
|
PassengerPreStart https://<%= fetch :domain -%>:443/
|
@@ -105,13 +105,16 @@ module Groundskeeper
|
|
105
105
|
end
|
106
106
|
# rubocop:enable Metrics/AbcSize
|
107
107
|
|
108
|
-
# rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity
|
108
|
+
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
|
109
|
+
# rubocop:disable Metrics/PerceivedComplexity
|
109
110
|
def release(options = {})
|
110
111
|
is_initial_release = !version_file.exists?
|
111
112
|
|
112
113
|
return missing_jira_credentials unless jira.credentials?
|
114
|
+
return missing_github_credentials unless git_hub.credentials?
|
113
115
|
return unless check_groundskeeper_version
|
114
116
|
return unrecognized_version unless version_file.rails?
|
117
|
+
|
115
118
|
version_file.create_initial_version! unless version_file.exists?
|
116
119
|
Executable.verbose = options[:verbose]
|
117
120
|
pull_project_details
|
@@ -127,8 +130,8 @@ module Groundskeeper
|
|
127
130
|
ask_add_version_to_jira_issues unless is_initial_release
|
128
131
|
open_pull_request_page
|
129
132
|
end
|
130
|
-
# rubocop:enable Metrics/AbcSize,Metrics/CyclomaticComplexity
|
131
|
-
# rubocop:enable Metrics/MethodLength
|
133
|
+
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity
|
134
|
+
# rubocop:enable Metrics/MethodLength, Metrics/PerceivedComplexity
|
132
135
|
|
133
136
|
# :nocov:
|
134
137
|
def predeploy(options = {})
|
@@ -142,11 +145,12 @@ module Groundskeeper
|
|
142
145
|
# :nocov:
|
143
146
|
|
144
147
|
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
|
145
|
-
# rubocop:disable Metrics/MethodLength
|
148
|
+
# rubocop:disable Metrics/MethodLength, Metrics/PerceivedComplexity
|
146
149
|
def deploy(options = {})
|
147
150
|
return unrecognized_version unless version_file.exists?
|
148
151
|
return unrecognized_tag unless tag_present_in_git?(ENV[TAG])
|
149
152
|
return missing_jira_credentials unless jira.credentials?
|
153
|
+
return missing_sentry_credentials unless sentry.credentials?
|
150
154
|
return unless check_groundskeeper_version
|
151
155
|
Executable.verbose = options[:verbose]
|
152
156
|
pull_project_details
|
@@ -159,7 +163,7 @@ module Groundskeeper
|
|
159
163
|
add_version_to_sentry
|
160
164
|
end
|
161
165
|
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity
|
162
|
-
# rubocop:enable Metrics/MethodLength
|
166
|
+
# rubocop:enable Metrics/MethodLength, Metrics/PerceivedComplexity
|
163
167
|
|
164
168
|
private
|
165
169
|
|
@@ -330,6 +334,20 @@ module Groundskeeper
|
|
330
334
|
)
|
331
335
|
end
|
332
336
|
|
337
|
+
def missing_sentry_credentials
|
338
|
+
console.say(
|
339
|
+
"Please configure your Sentry environment variables.",
|
340
|
+
:red
|
341
|
+
)
|
342
|
+
end
|
343
|
+
|
344
|
+
def missing_github_credentials
|
345
|
+
console.say(
|
346
|
+
"Please configure your GitHub environment variables.",
|
347
|
+
:red
|
348
|
+
)
|
349
|
+
end
|
350
|
+
|
333
351
|
def open_pull_request_page
|
334
352
|
return unless did_checkout_branch && did_push_to_remote
|
335
353
|
|
@@ -5,6 +5,7 @@ module Groundskeeper
|
|
5
5
|
class GitHub
|
6
6
|
attr_reader :opener, :username, :repository_name
|
7
7
|
|
8
|
+
GITHUB_API_TOKEN = "GITHUB_API_TOKEN"
|
8
9
|
COMMAND = "open"
|
9
10
|
URL_BASE = "https://github.com/"
|
10
11
|
|
@@ -28,5 +29,9 @@ module Groundskeeper
|
|
28
29
|
|
29
30
|
opener.execute(url)
|
30
31
|
end
|
32
|
+
|
33
|
+
def credentials?
|
34
|
+
ENV[GITHUB_API_TOKEN].present?
|
35
|
+
end
|
31
36
|
end
|
32
37
|
end
|
@@ -9,7 +9,7 @@ module Groundskeeper
|
|
9
9
|
attr_reader :details, :servers, :repo_name
|
10
10
|
|
11
11
|
DETAILS_PATH = "~/.project_details/projects.yml"
|
12
|
-
SERVERS_PATH = "
|
12
|
+
SERVERS_PATH = "~/.project_details/servers.yml"
|
13
13
|
JIRA_PREFIX_KEY = "jira_prefix"
|
14
14
|
PROJECT_NAME_KEY = "name"
|
15
15
|
SOURCE_CONTROL_USERNAME_KEY = "scm_username"
|
@@ -17,7 +17,6 @@ module Groundskeeper
|
|
17
17
|
RVM_RUBY_VERSION_KEY = "ruby_version"
|
18
18
|
DB_ENV_VARIABLES_KEY = "db_env_variables"
|
19
19
|
SENTRY_DSN_KEY = "sentry_dsn"
|
20
|
-
SENTRY_PUBLIC_DSN_KEY = "sentry_public_dsn"
|
21
20
|
SENTRY_PROJECT_KEY = "sentry_project"
|
22
21
|
SSL_CERTIFICATE_FILE_KEY = "SSLCertificateFile"
|
23
22
|
SSL_CERTIFICATE_CHAIN_FILE_KEY = "SSLCertificateChainFile"
|
@@ -81,12 +80,6 @@ module Groundskeeper
|
|
81
80
|
end
|
82
81
|
# :nocov:
|
83
82
|
|
84
|
-
# :nocov:
|
85
|
-
def sentry_public_dsn
|
86
|
-
details[SENTRY_PUBLIC_DSN_KEY] || ""
|
87
|
-
end
|
88
|
-
# :nocov:
|
89
|
-
|
90
83
|
def sentry_project
|
91
84
|
details[SENTRY_PROJECT_KEY] || ""
|
92
85
|
end
|
data/lib/groundskeeper/sentry.rb
CHANGED
@@ -4,6 +4,8 @@ module Groundskeeper
|
|
4
4
|
# Wraps Sentry CLI executable.
|
5
5
|
class Sentry
|
6
6
|
COMMAND = "sentry-cli"
|
7
|
+
SENTRY_AUTH_TOKEN = "SENTRY_AUTH_TOKEN"
|
8
|
+
SENTRY_ORG = "SENTRY_ORG"
|
7
9
|
# sentry-cli arguments
|
8
10
|
RELEASE = "releases new -p %<project>s \"%<version>s\""
|
9
11
|
ASSOCIATE = "releases set-commits --auto \"%<version>s\""
|
@@ -47,5 +49,9 @@ module Groundskeeper
|
|
47
49
|
def version_name(version)
|
48
50
|
"#{version_prefix} #{version}"
|
49
51
|
end
|
52
|
+
|
53
|
+
def credentials?
|
54
|
+
ENV[SENTRY_AUTH_TOKEN].present? && ENV[SENTRY_ORG].present?
|
55
|
+
end
|
50
56
|
end
|
51
57
|
end
|
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.3.
|
4
|
+
version: 0.3.4
|
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: 2019-01-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jira-ruby
|
@@ -186,7 +186,6 @@ files:
|
|
186
186
|
- lib/groundskeeper/string_utils.rb
|
187
187
|
- lib/groundskeeper/version.rb
|
188
188
|
- lib/groundskeeper/website.rb
|
189
|
-
- servers.yml
|
190
189
|
homepage: https://github.com/NU-CBITS/groundskeeper.git
|
191
190
|
licenses:
|
192
191
|
- MIT
|
data/servers.yml
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
cbits-railsapps-staging:
|
2
|
-
domain: cbits-railsapps-staging.nubic.northwestern.edu
|
3
|
-
cbits-railsapps:
|
4
|
-
domain: cbits-railsapps.nubic.northwestern.edu
|
5
|
-
vtfsmcbitsapps01:
|
6
|
-
domain: vtfsmcbitsapps01.fsm.northwestern.edu
|
7
|
-
vfsmcbitsapps10:
|
8
|
-
domain: vfsmcbitsapps10.fsm.northwestern.edu
|
9
|
-
vfsmcbitsapps11:
|
10
|
-
domain: vfsmcbitsapps11.fsm.northwestern.edu
|
11
|
-
vfsmcbitsapps12:
|
12
|
-
domain: vfsmcbitsapps12.fsm.northwestern.edu
|
13
|
-
vfsmcbitsapps13:
|
14
|
-
domain: vfsmcbitsapps13.fsm.northwestern.edu
|
15
|
-
isgmh_staging_1:
|
16
|
-
domain: vtfsmisgmhapp01.fsm.northwestern.edu
|