smart_proxy_dynflow 0.2.2 → 0.2.3
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 +5 -5
- data/Gemfile +0 -1
- data/lib/smart_proxy_dynflow/http_config.ru +18 -4
- data/lib/smart_proxy_dynflow/plugin.rb +14 -15
- data/lib/smart_proxy_dynflow/version.rb +1 -1
- data/settings.d/dynflow.yml.example +5 -0
- metadata +3 -4
- data/lib/smart_proxy_dynflow/http_config_with_executor.ru +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0e7c4b7a5345d0fea21625215d19a42ec7a541c5978d2291a2fb8e8cb7ecc378
|
4
|
+
data.tar.gz: c7b4448023317d8c5e72afc6ea835ca2bf40bceec8a2ab30f426a2f7c990be7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e86febbe3ca408556048ec71330272836f04425ef3c45bc619bb0dd9f53403af23d6b653d3d0f6e84237e6068e7ddc9fe3231e33923ea77dff639d017aa7966
|
7
|
+
data.tar.gz: c73d982c4ec17251509b5ec1aa967893597a391bc529b09f2aaec3d2736c213e69706d1f64a7bfc23e7faf4dfe72bf0a06ad1c833ca6d47ec9748b4e29e86d13
|
data/Gemfile
CHANGED
@@ -1,7 +1,21 @@
|
|
1
|
-
|
1
|
+
# Internal core will be used if external core is either disabled or unset
|
2
|
+
# and the core gem can be loaded
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
|
4
|
+
if !::Proxy::Dynflow::Plugin.settings.external_core && Proxy::Dynflow::Plugin.internal_core_available?
|
5
|
+
require 'smart_proxy_dynflow_core/api'
|
6
|
+
require 'smart_proxy_dynflow_core/launcher'
|
7
|
+
|
8
|
+
SmartProxyDynflowCore::Settings.load_from_proxy(p)
|
9
|
+
|
10
|
+
map "/dynflow" do
|
11
|
+
SmartProxyDynflowCore::Launcher.route_mapping(self)
|
12
|
+
end
|
13
|
+
else
|
14
|
+
require 'smart_proxy_dynflow/api'
|
15
|
+
|
16
|
+
map "/dynflow" do
|
17
|
+
map '/' do
|
18
|
+
run Proxy::Dynflow::Api
|
19
|
+
end
|
6
20
|
end
|
7
21
|
end
|
@@ -4,29 +4,28 @@ require 'proxy/plugin'
|
|
4
4
|
|
5
5
|
class Proxy::Dynflow
|
6
6
|
class Plugin < Proxy::Plugin
|
7
|
-
rackup_path =
|
8
|
-
|
9
|
-
|
10
|
-
rescue LoadError
|
11
|
-
'http_config.ru'
|
12
|
-
end
|
13
|
-
http_rackup_path File.expand_path(rackup_path, File.expand_path("../", __FILE__))
|
14
|
-
https_rackup_path File.expand_path(rackup_path, File.expand_path("../", __FILE__))
|
7
|
+
rackup_path = File.expand_path('http_config.ru', __dir__)
|
8
|
+
http_rackup_path rackup_path
|
9
|
+
https_rackup_path rackup_path
|
15
10
|
|
16
11
|
settings_file "dynflow.yml"
|
17
12
|
requires :foreman_proxy, ">= 1.12.0"
|
18
13
|
default_settings :core_url => 'http://localhost:8008'
|
19
14
|
plugin :dynflow, Proxy::Dynflow::VERSION
|
20
15
|
|
21
|
-
# rubocop:disable Lint/HandleExceptions
|
22
16
|
after_activation do
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
# Dynflow core is not available in the proxy, will be handled
|
27
|
-
# by standalone Dynflow core
|
17
|
+
# Ensure the core gem is loaded, if configure NOT to use the external core
|
18
|
+
if Proxy::Dynflow::Plugin.settings.external_core == false && !internal_core_available?
|
19
|
+
raise "'smart_proxy_dynflow_core' gem is required, but not available"
|
28
20
|
end
|
29
21
|
end
|
30
|
-
|
22
|
+
|
23
|
+
def self.internal_core_available?
|
24
|
+
@core_available ||= begin
|
25
|
+
require 'smart_proxy_dynflow_core'
|
26
|
+
true
|
27
|
+
rescue LoadError # rubocop:disable Lint/HandleExceptions
|
28
|
+
end
|
29
|
+
end
|
31
30
|
end
|
32
31
|
end
|
@@ -2,3 +2,8 @@
|
|
2
2
|
:enabled: true
|
3
3
|
:database: /var/lib/foreman-proxy/dynflow/dynflow.sqlite
|
4
4
|
:core_url: 'http://127.0.0.1:8008'
|
5
|
+
|
6
|
+
# If true, external core will be used even if the core gem is available
|
7
|
+
# If false, the feature will be disabled if the core gem is not available
|
8
|
+
# If unset, the process will fallback to external core if the core gem is not available
|
9
|
+
# :external_core: true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_proxy_dynflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Nečas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -109,7 +109,6 @@ files:
|
|
109
109
|
- lib/smart_proxy_dynflow/callback.rb
|
110
110
|
- lib/smart_proxy_dynflow/helpers.rb
|
111
111
|
- lib/smart_proxy_dynflow/http_config.ru
|
112
|
-
- lib/smart_proxy_dynflow/http_config_with_executor.ru
|
113
112
|
- lib/smart_proxy_dynflow/plugin.rb
|
114
113
|
- lib/smart_proxy_dynflow/proxy_adapter.rb
|
115
114
|
- lib/smart_proxy_dynflow/version.rb
|
@@ -134,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
133
|
version: '0'
|
135
134
|
requirements: []
|
136
135
|
rubyforge_project:
|
137
|
-
rubygems_version: 2.6
|
136
|
+
rubygems_version: 2.7.6
|
138
137
|
signing_key:
|
139
138
|
specification_version: 4
|
140
139
|
summary: Dynflow runtime for Foreman smart proxy
|