disco_app 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/jobs/disco_app/concerns/synchronise_carrier_service_job.rb +20 -11
- data/app/jobs/disco_app/concerns/synchronise_webhooks_job.rb +8 -0
- data/lib/disco_app/version.rb +1 -1
- data/lib/generators/disco_app/{rollbarify/rollbarify_generator.rb → monitorify/monitorify_generator.rb} +5 -3
- data/lib/generators/disco_app/monitorify/templates/config/newrelic.yml +26 -0
- data/lib/generators/disco_app/{rollbarify → monitorify}/templates/initializers/rollbar.rb +0 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2aea621a853026f74eafff2e73f50d988c2ee307c34d695e3bec09d91fa1a89e
|
4
|
+
data.tar.gz: 3b52502b57d84599268706459a7e87953436bd9ea2058e0419e96053252813fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 867867d75021ba2020107b0ade11795dff0154da13ac82807702c006e7c8091e99a183ea2ea652469c27324211e6668c819cb6922058e8e5caaa560ce7d9e9ab
|
7
|
+
data.tar.gz: a414302c5d3291c64bc018179bb6db40f23dccb09aa7cd3c0a41f75eb33b76dde0bfbd9e595c1ab50df0635ea189fa907f198ef8f188f9b0c668da24e178b7a0
|
@@ -6,16 +6,25 @@ module DiscoApp::Concerns::SynchroniseCarrierServiceJob
|
|
6
6
|
# Don't proceed unless we have a name and callback url.
|
7
7
|
return unless carrier_service_name and callback_url
|
8
8
|
|
9
|
-
#
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
9
|
+
# Registered the carrier service if it hasn't been registered yet.
|
10
|
+
unless current_carrier_service_names.include?(carrier_service_name)
|
11
|
+
ShopifyAPI::CarrierService.create(
|
12
|
+
name: carrier_service_name,
|
13
|
+
callback_url: callback_url,
|
14
|
+
service_discovery: true,
|
15
|
+
format: :json
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Ensure any existing carrier services (with the correct name) are active
|
20
|
+
# and have a current callback URL.
|
21
|
+
current_carrier_services.each do |carrier_service|
|
22
|
+
if carrier_service.name == carrier_service_name
|
23
|
+
carrier_service.callback_url = callback_url
|
24
|
+
carrier_service.active = true
|
25
|
+
carrier_service.save
|
26
|
+
end
|
27
|
+
end
|
19
28
|
end
|
20
29
|
|
21
30
|
protected
|
@@ -30,7 +39,7 @@ module DiscoApp::Concerns::SynchroniseCarrierServiceJob
|
|
30
39
|
|
31
40
|
private
|
32
41
|
|
33
|
-
# Return a list of currently registered
|
42
|
+
# Return a list of currently registered carrier service names.
|
34
43
|
def current_carrier_service_names
|
35
44
|
current_carrier_services.map(&:name)
|
36
45
|
end
|
@@ -22,6 +22,14 @@ module DiscoApp::Concerns::SynchroniseWebhooksJob
|
|
22
22
|
webhook.delete
|
23
23
|
end
|
24
24
|
end
|
25
|
+
|
26
|
+
# Ensure webhook addresses are current.
|
27
|
+
current_webhooks.each do |webhook|
|
28
|
+
unless webhook.address == webhooks_url
|
29
|
+
webhook.address = webhooks_url
|
30
|
+
webhook.save
|
31
|
+
end
|
32
|
+
end
|
25
33
|
end
|
26
34
|
|
27
35
|
protected
|
data/lib/disco_app/version.rb
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
module DiscoApp
|
2
2
|
module Generators
|
3
|
-
class
|
3
|
+
class MonitorifyGenerator < Rails::Generators::Base
|
4
4
|
|
5
5
|
source_root File.expand_path('../templates', __FILE__)
|
6
6
|
|
7
|
-
# Install the Rollbar and
|
7
|
+
# Install the Rollbar, OJ and New Relic gems.
|
8
8
|
def install_gems
|
9
9
|
# Add gem to Gemfile
|
10
10
|
gem 'rollbar', '~> 2.7.1'
|
11
11
|
gem 'oj', '~> 2.14.3'
|
12
|
+
gem 'newrelic_rpm', '~> 3.14.1.311'
|
12
13
|
|
13
14
|
# Install gem.
|
14
15
|
Bundler.with_clean_env do
|
@@ -16,9 +17,10 @@ module DiscoApp
|
|
16
17
|
end
|
17
18
|
end
|
18
19
|
|
19
|
-
# Copy initializer.
|
20
|
+
# Copy Rollbar initializer and New Relic config file.
|
20
21
|
def configure
|
21
22
|
copy_file 'initializers/rollbar.rb', 'config/initializers/rollbar.rb'
|
23
|
+
copy_file 'config/newrelic.yml', 'config/newrelic.yml'
|
22
24
|
end
|
23
25
|
|
24
26
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# This file configures the New Relic Agent.
|
2
|
+
#
|
3
|
+
# For full documentation of agent configuration options, please refer to
|
4
|
+
# https://docs.newrelic.com/docs/agents/ruby-agent/installation-configuration/ruby-agent-configuration
|
5
|
+
|
6
|
+
common: &default_settings
|
7
|
+
license_key: <%= ENV['NEW_RELIC_LICENSE_KEY'] %>
|
8
|
+
app_name: <%= ENV['SHOPIFY_APP_NAME'] || 'Unknown App' %>
|
9
|
+
|
10
|
+
# To disable the agent regardless of other settings, uncomment the following:
|
11
|
+
# agent_enabled: false
|
12
|
+
|
13
|
+
# Logging level for log/newrelic_agent.log
|
14
|
+
log_level: info
|
15
|
+
|
16
|
+
development:
|
17
|
+
<<: *default_settings
|
18
|
+
app_name: <%= ENV['SHOPIFY_APP_NAME'] || 'Unknown App' %> (Development)
|
19
|
+
developer_mode: true
|
20
|
+
|
21
|
+
test:
|
22
|
+
<<: *default_settings
|
23
|
+
monitor_mode: false
|
24
|
+
|
25
|
+
production:
|
26
|
+
<<: *default_settings
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: disco_app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gavin Ballard
|
@@ -341,9 +341,10 @@ files:
|
|
341
341
|
- lib/generators/disco_app/USAGE
|
342
342
|
- lib/generators/disco_app/disco_app_generator.rb
|
343
343
|
- lib/generators/disco_app/mailify/mailify_generator.rb
|
344
|
+
- lib/generators/disco_app/monitorify/monitorify_generator.rb
|
345
|
+
- lib/generators/disco_app/monitorify/templates/config/newrelic.yml
|
346
|
+
- lib/generators/disco_app/monitorify/templates/initializers/rollbar.rb
|
344
347
|
- lib/generators/disco_app/reactify/reactify_generator.rb
|
345
|
-
- lib/generators/disco_app/rollbarify/rollbarify_generator.rb
|
346
|
-
- lib/generators/disco_app/rollbarify/templates/initializers/rollbar.rb
|
347
348
|
- lib/generators/disco_app/templates/assets/javascripts/application.js
|
348
349
|
- lib/generators/disco_app/templates/assets/stylesheets/application.scss
|
349
350
|
- lib/generators/disco_app/templates/config/puma.rb
|