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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 79fab46f840dcb22b53fc55e4cdc362e77f393e3
4
- data.tar.gz: bf56a82bf703d2148ec68ba65e45fad8a69f0a9d
3
+ metadata.gz: 5226b29a0e4aca883b307266416d0e2fe9a03418
4
+ data.tar.gz: d2389f396c568033925b7ecab7d858239a518924
5
5
  SHA512:
6
- metadata.gz: c1d1fe310cef1e8f3df71cc2c93af055c9e490456ef43eac0a322a47f384e3c04fbc435910fd8c5d8e72bdebb4ae219e0686eeb79180333c2b51b5225c034730
7
- data.tar.gz: 012d6f338c90a6fed4ed6f0a8abb9ad1ddf8171c3a40d88e69169fe5b4c0ef73130da7c86163e4eee47cf8c7543bfedd1e204dfdc8a7739abe1c9b97e6fc9164
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
@@ -1,88 +1,87 @@
1
1
  <% project = fetch :project %>
2
2
  Rails.application.configure do
3
- # For catching exceptions
4
- config.sentry_dsn = '<%= project.sentry_dsn %>'
5
- config.sentry_public_dsn = '<%= project.sentry_public_dsn %>'
3
+ # For catching exceptions
4
+ config.sentry_dsn = '<%= project.sentry_dsn %>'
6
5
 
7
- # Settings specified here will take precedence over those in config/application.rb.
6
+ # Settings specified here will take precedence over those in config/application.rb.
8
7
 
9
- # Code is not reloaded between requests.
10
- config.cache_classes = true
8
+ # Code is not reloaded between requests.
9
+ config.cache_classes = true
11
10
 
12
- # Eager load code on boot. This eager loads most of Rails and
13
- # your application in memory, allowing both thread web servers
14
- # and those relying on copy on write to perform better.
15
- # Rake tasks automatically ignore this option for performance.
16
- config.eager_load = true
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
- # Full error reports are disabled and caching is turned on.
19
- config.consider_all_requests_local = false
20
- config.action_controller.perform_caching = true
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
- # Disable serving static files from the `/public` folder by default since
23
- # Apache or NGINX already handles this.
24
- config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
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
- # Compress JavaScripts and CSS.
27
- config.assets.js_compressor = :uglifier
28
- # config.assets.css_compressor = :sass
25
+ # Compress JavaScripts and CSS.
26
+ config.assets.js_compressor = :uglifier
27
+ # config.assets.css_compressor = :sass
29
28
 
30
- # Do not fallback to assets pipeline if a precompiled asset is missed.
31
- config.assets.compile = false
29
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
30
+ config.assets.compile = false
32
31
 
33
- # Specifies the header that your server uses for sending files.
34
- config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for apache
35
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
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
- # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
38
- config.force_ssl = true
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
- # Set to :debug to see everything in the log.
41
- config.log_level = :info
39
+ # Set to :debug to see everything in the log.
40
+ config.log_level = :info
42
41
 
43
- # Prepend all log lines with the following tags.
44
- config.log_tags = [ :request_id ]
42
+ # Prepend all log lines with the following tags.
43
+ config.log_tags = [ :request_id ]
45
44
 
46
- # Use a different logger for distributed setups.
47
- # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
45
+ # Use a different logger for distributed setups.
46
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
48
47
 
49
- # Use a different cache store in production.
50
- # config.cache_store = :mem_cache_store
48
+ # Use a different cache store in production.
49
+ # config.cache_store = :mem_cache_store
51
50
 
52
- config.action_mailer.perform_caching = false
51
+ config.action_mailer.perform_caching = false
53
52
 
54
- # Precompile additional assets.
55
- # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
56
- # config.assets.precompile += %w( search.js )
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
- # Ignore bad email addresses and do not raise email delivery errors.
59
- # Set this to true and configure the email server for immediate delivery to raise delivery errors.
60
- config.action_mailer.default_url_options = { host: '<%= fetch :domain %>' }
61
- config.action_mailer.delivery_method = :smtp
62
- config.action_mailer.raise_delivery_errors = false
63
- config.action_mailer.perform_deliveries = true
64
- config.action_mailer.smtp_settings = {
65
- authentication: :plain,
66
- address: 'smtp.mailgun.org',
67
- port: 587,
68
- domain: 'cbits.northwestern.edu',
69
- user_name: ENV['mailgun_db_username'],
70
- password: ENV['mailgun_db_password']
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
- Rails.application.routes.default_url_options[:host] = '<%= fetch :domain %>'
74
- Rails.application.routes.default_url_options[:protocol] = 'https'
72
+ Rails.application.routes.default_url_options[:host] = '<%= fetch :domain %>'
73
+ Rails.application.routes.default_url_options[:protocol] = 'https'
75
74
 
76
- # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
77
- # the I18n.default_locale when a translation can not be found).
78
- config.i18n.fallbacks = true
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
- # Send deprecation notices to registered listeners.
81
- config.active_support.deprecation = :notify
79
+ # Send deprecation notices to registered listeners.
80
+ config.active_support.deprecation = :notify
82
81
 
83
- # Disable automatic flushing of the log to improve performance.
84
- # config.autoflush_log = false
82
+ # Disable automatic flushing of the log to improve performance.
83
+ # config.autoflush_log = false
85
84
 
86
- # Use default logging formatter so that PID and timestamp are not suppressed.
87
- config.log_formatter = ::Logger::Formatter.new
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
- 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>
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 = "../../servers.yml"
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
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Groundskeeper
4
- VERSION = "0.3.3"
4
+ VERSION = "0.3.4"
5
5
  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.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: 2018-11-16 00:00:00.000000000 Z
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