smart_proxy_dynflow_core 0.3.0 → 0.4.1

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
  SHA256:
3
- metadata.gz: 467f03a2c2c0ad4e3b168039abdb8e9a465a46b8ecf44aade57c5a09bbeafbfc
4
- data.tar.gz: e966e14e4a95f42af61b5bcf47595ad6afa241271656b6724e5000b3e2cd354d
3
+ metadata.gz: 0e1f105cbe477f78311c82772782b16c82bd50c22f7c8aee89b7a29afd3e247d
4
+ data.tar.gz: e0fd26ed1d6f54996752255c5d57182b0d9556a18ff2555e47d782fbe10bde28
5
5
  SHA512:
6
- metadata.gz: e6a3b2b7b4dc313c1b6cc215c2de6cda4f49ad9f901bc7ab949b0ed4a16521e021b9c39a0fc371091e54172610787f968a2bb8577f68086ef15308bd805fc970
7
- data.tar.gz: 7cbfc949016d5d824ebbb421093c8ef687c24d33c6699e7ef0c875145e035e8233317ff64c7757597bd0e76c9186566dec4e407397e32803b6d42ea26602fb6f
6
+ metadata.gz: 8e29ff97a07bb940fa2a7d5b121f90ac249b11083309fd8b013f2fe1e2f4facb806b1717680054b33b760de6d1f4621c3c24c8b56add7d1e13f1131c07cb6626
7
+ data.tar.gz: 0a6bc60a9e6f93a0955c76e338262399df7681f210ed15dde1e1695f7acf313e60ea72964bd5f5ddaf599f57dd623062c74417c6204be72aa6cc2bb96ff58740
data/Gemfile CHANGED
@@ -15,15 +15,10 @@ group :test do
15
15
  gem 'rubocop', '~> 0.52.1'
16
16
  end
17
17
 
18
- gem 'logging-journald', '~> 2.0', :platforms => [:ruby]
18
+ gem 'logging-journald', '~> 2.0', :platforms => [:ruby], :require => false
19
19
  gem 'rack', '>= 1.1'
20
20
  gem 'sinatra'
21
21
 
22
- # load bundler.d
23
- Dir["#{File.dirname(__FILE__)}/bundler.d/*.rb"].each do |bundle|
24
- self.instance_eval(Bundler.read_file(bundle))
25
- end
26
-
27
22
  # load local gemfile
28
23
  local_gemfile = File.join(File.dirname(__FILE__), 'Gemfile.local.rb')
29
24
  self.instance_eval(Bundler.read_file(local_gemfile)) if File.exist?(local_gemfile)
@@ -1,19 +1,13 @@
1
- require 'dynflow'
2
- require 'smart_proxy_dynflow_core/request_id_middleware'
3
- require 'smart_proxy_dynflow_core/logger_middleware'
4
- require 'smart_proxy_dynflow_core/middleware/keep_current_request_id'
1
+ # Whatever is here is just a compatibility layer
2
+ # Once all the _core have been migrated, this can be dropped.
3
+
4
+ require 'smart_proxy_dynflow'
5
+
6
+ # REX core explicitly requires this file, otherwise we could use the trick we
7
+ # use with callback
5
8
  require 'smart_proxy_dynflow_core/task_launcher_registry'
6
- require 'foreman_tasks_core'
7
- require 'smart_proxy_dynflow_core/log'
8
- require 'smart_proxy_dynflow_core/settings'
9
- require 'smart_proxy_dynflow_core/core'
10
- require 'smart_proxy_dynflow_core/helpers'
11
- require 'smart_proxy_dynflow_core/callback'
12
- require 'smart_proxy_dynflow_core/api'
13
9
 
14
10
  module SmartProxyDynflowCore
15
- Core.after_initialize do |dynflow_core|
16
- ForemanTasksCore.dynflow_setup(dynflow_core.world)
17
- end
18
- Core.register_silencer_matchers ForemanTasksCore.silent_dead_letter_matchers
11
+ Callback = Proxy::Dynflow::Callback
12
+ Log = Proxy::Dynflow::Log
19
13
  end
@@ -1,31 +1,3 @@
1
1
  module SmartProxyDynflowCore
2
- class TaskLauncherRegistry
3
- class << self
4
- def register(name, launcher)
5
- registry[name] = launcher
6
- end
7
-
8
- def fetch(name, default = nil)
9
- if default.nil?
10
- registry.fetch(name)
11
- else
12
- registry.fetch(name, default)
13
- end
14
- end
15
-
16
- def key?(name)
17
- registry.key?(name)
18
- end
19
-
20
- def operations
21
- registry.keys
22
- end
23
-
24
- private
25
-
26
- def registry
27
- @registry ||= {}
28
- end
29
- end
30
- end
2
+ TaskLauncherRegistry = Proxy::Dynflow::TaskLauncherRegistry
31
3
  end
@@ -1,3 +1,3 @@
1
1
  module SmartProxyDynflowCore
2
- VERSION = '0.3.0'.freeze
2
+ VERSION = '0.4.1'.freeze
3
3
  end
@@ -13,10 +13,8 @@ Gem::Specification.new do |gem|
13
13
  Use the Dynflow inside Foreman smart proxy
14
14
  EOS
15
15
 
16
- gem.executables = ['smart_proxy_dynflow_core']
17
- gem.files = Dir['lib/smart_proxy_dynflow_core.rb', 'config/settings.yml.example',
18
- 'lib/smart_proxy_dynflow_core/*', 'LICENSE', 'Gemfile',
19
- 'bin/smart_proxy_dynflow_core', 'deploy/*', 'smart_proxy_dynflow_core.gemspec']
16
+ gem.files = Dir['lib/smart_proxy_dynflow_core.rb', 'lib/smart_proxy_dynflow_core/**/*',
17
+ 'LICENSE', 'Gemfile', 'smart_proxy_dynflow_core.gemspec']
20
18
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
21
19
  gem.require_paths = ["lib"]
22
20
  gem.license = 'GPL-3.0'
@@ -24,19 +22,5 @@ Gem::Specification.new do |gem|
24
22
  gem.required_ruby_version = '~> 2.5'
25
23
 
26
24
  gem.add_development_dependency "bundler", ">= 1.7"
27
- gem.add_development_dependency('minitest')
28
- gem.add_development_dependency('mocha', '~> 1')
29
- gem.add_development_dependency('rack-test', '~> 0')
30
- gem.add_development_dependency "rake", "~> 10.0"
31
- gem.add_development_dependency('webmock', '~> 1')
32
-
33
- gem.add_runtime_dependency('dynflow', "~> 1.1")
34
- gem.add_runtime_dependency('foreman-tasks-core', '>= 0.3.3')
35
- gem.add_runtime_dependency('logging')
36
- gem.add_runtime_dependency('rack')
37
- gem.add_runtime_dependency('rest-client')
38
- gem.add_runtime_dependency('sd_notify', '~> 0.1')
39
- gem.add_runtime_dependency('sequel')
40
- gem.add_runtime_dependency('sinatra')
41
- gem.add_runtime_dependency('sqlite3')
25
+ gem.add_runtime_dependency('smart_proxy_dynflow', '~> 0.5')
42
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_proxy_dynflow_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.1
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: 1980-01-01 00:00:00.000000000 Z
11
+ date: 2021-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -25,228 +25,30 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.7'
27
27
  - !ruby/object:Gem::Dependency
28
- name: minitest
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: mocha
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '1'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '1'
55
- - !ruby/object:Gem::Dependency
56
- name: rack-test
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: rake
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '10.0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '10.0'
83
- - !ruby/object:Gem::Dependency
84
- name: webmock
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '1'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '1'
97
- - !ruby/object:Gem::Dependency
98
- name: dynflow
28
+ name: smart_proxy_dynflow
99
29
  requirement: !ruby/object:Gem::Requirement
100
30
  requirements:
101
31
  - - "~>"
102
32
  - !ruby/object:Gem::Version
103
- version: '1.1'
33
+ version: '0.5'
104
34
  type: :runtime
105
35
  prerelease: false
106
36
  version_requirements: !ruby/object:Gem::Requirement
107
37
  requirements:
108
38
  - - "~>"
109
39
  - !ruby/object:Gem::Version
110
- version: '1.1'
111
- - !ruby/object:Gem::Dependency
112
- name: foreman-tasks-core
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: 0.3.3
118
- type: :runtime
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: 0.3.3
125
- - !ruby/object:Gem::Dependency
126
- name: logging
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :runtime
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: rack
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :runtime
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
- - !ruby/object:Gem::Dependency
154
- name: rest-client
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: '0'
160
- type: :runtime
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: '0'
167
- - !ruby/object:Gem::Dependency
168
- name: sd_notify
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - "~>"
172
- - !ruby/object:Gem::Version
173
- version: '0.1'
174
- type: :runtime
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - "~>"
179
- - !ruby/object:Gem::Version
180
- version: '0.1'
181
- - !ruby/object:Gem::Dependency
182
- name: sequel
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - ">="
186
- - !ruby/object:Gem::Version
187
- version: '0'
188
- type: :runtime
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - ">="
193
- - !ruby/object:Gem::Version
194
- version: '0'
195
- - !ruby/object:Gem::Dependency
196
- name: sinatra
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - ">="
200
- - !ruby/object:Gem::Version
201
- version: '0'
202
- type: :runtime
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - ">="
207
- - !ruby/object:Gem::Version
208
- version: '0'
209
- - !ruby/object:Gem::Dependency
210
- name: sqlite3
211
- requirement: !ruby/object:Gem::Requirement
212
- requirements:
213
- - - ">="
214
- - !ruby/object:Gem::Version
215
- version: '0'
216
- type: :runtime
217
- prerelease: false
218
- version_requirements: !ruby/object:Gem::Requirement
219
- requirements:
220
- - - ">="
221
- - !ruby/object:Gem::Version
222
- version: '0'
40
+ version: '0.5'
223
41
  description: " Use the Dynflow inside Foreman smart proxy\n"
224
42
  email:
225
43
  - inecas@redhat.com
226
- executables:
227
- - smart_proxy_dynflow_core
44
+ executables: []
228
45
  extensions: []
229
46
  extra_rdoc_files: []
230
47
  files:
231
48
  - Gemfile
232
49
  - LICENSE
233
- - bin/smart_proxy_dynflow_core
234
- - config/settings.yml.example
235
- - deploy/smart_proxy_dynflow_core.init
236
- - deploy/smart_proxy_dynflow_core.service
237
50
  - lib/smart_proxy_dynflow_core.rb
238
- - lib/smart_proxy_dynflow_core/api.rb
239
- - lib/smart_proxy_dynflow_core/bundler_helper.rb
240
- - lib/smart_proxy_dynflow_core/callback.rb
241
- - lib/smart_proxy_dynflow_core/core.rb
242
- - lib/smart_proxy_dynflow_core/helpers.rb
243
- - lib/smart_proxy_dynflow_core/launcher.rb
244
- - lib/smart_proxy_dynflow_core/log.rb
245
- - lib/smart_proxy_dynflow_core/logger_middleware.rb
246
- - lib/smart_proxy_dynflow_core/request_id_middleware.rb
247
- - lib/smart_proxy_dynflow_core/settings.rb
248
51
  - lib/smart_proxy_dynflow_core/task_launcher_registry.rb
249
- - lib/smart_proxy_dynflow_core/testing.rb
250
52
  - lib/smart_proxy_dynflow_core/version.rb
251
53
  - smart_proxy_dynflow_core.gemspec
252
54
  homepage: https://github.com/theforeman/smart_proxy_dynflow
@@ -1,32 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require 'dynflow'
3
- require 'rack'
4
- require 'smart_proxy_dynflow_core/launcher'
5
- require 'yaml'
6
- require 'optparse'
7
-
8
- options = {}
9
- OptionParser.new do |opts|
10
- opts.on('-c', '--config-dir CONFIG_DIR', String, 'Directory to load settings from') do |value|
11
- options[:config_dir] = value
12
- end
13
-
14
- opts.on('-1', '--one-config', 'Do not load more than 1 config') do |value|
15
- options[:one_config] = true
16
- end
17
-
18
- opts.on('-d', '--[no-]daemonize', 'Fork to background after start') do |value|
19
- options[:daemonize] = value
20
- end
21
-
22
- opts.on('-p', '--pid-file PID_FILE', String, 'Write pid to this file') do |value|
23
- options[:pid_file] = value
24
- end
25
-
26
- opts.on_tail('-h', '--help', 'Show usage help') do
27
- puts opts
28
- exit
29
- end
30
- end.parse!
31
-
32
- SmartProxyDynflowCore::Launcher.launch! options
@@ -1,66 +0,0 @@
1
- ---
2
- # Path to dynflow database, leave blank for in-memory non-persistent database
3
- :database:
4
-
5
- # URL of the foreman, used for reporting back
6
- :foreman_url: 'http://localhost:3000'
7
-
8
- # SSL settings for client authentication against Foreman
9
- # :foreman_ssl_ca: ssl/foreman_ca.pem
10
- # :foreman_ssl_key: ssl/foreman_key.pem
11
- # :foreman_ssl_cert: ssl/foreman_cert.pem
12
-
13
- :console_auth: false
14
-
15
- # Set to true to make the core fork to background after start
16
- # :daemonize: false
17
- # :pid_file: /var/run/foreman-proxy/smart_proxy_dynflow_core.pid
18
-
19
- # Listen on address
20
- :listen: 127.0.0.1
21
-
22
- # Listen on port
23
- :port: 8008
24
-
25
- # SSL settings for running core as https service
26
- # :use_https: false
27
- # :ssl_ca_file: ssl/ca.pem
28
- # :ssl_private_key: ssl/localhost.pem
29
- # :ssl_certificate: ssl/certs/localhost.pem
30
-
31
- # Use this option only if you need to disable certain cipher suites.
32
- # Note: we use the OpenSSL suite name, take a look at:
33
- # https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER-SUITE-NAMES
34
- # for more information.
35
- #:ssl_disabled_ciphers: [CIPHER-SUITE-1, CIPHER-SUITE-2]
36
-
37
- # Use this option only if you need to strictly specify TLS versions to be
38
- # disabled. SSLv3 and TLS v1.0 are always disabled and cannot be configured.
39
- # Specify versions like: '1.1', or '1.2'
40
- #:tls_disabled_versions: []
41
-
42
- # File to log to, leave empty for stdout or use STDOUT, STDERR, SYSLOG or JOURNAL
43
- #:log_file: /var/log/foreman-proxy/smart_proxy_dynflow_core.log
44
-
45
- # Log level, one of UNKNOWN, FATAL, ERROR, WARN, INFO, DEBUG
46
- #:log_level: ERROR
47
-
48
- # The maximum size of a log file before it's rolled (in MiB) or zero to disable file rolling
49
- # and rely on logrotate or similar tool
50
- #:file_rolling_size: 0
51
-
52
- # The maximum age of a log file before it's rolled (in seconds). Also accepts 'daily', 'weekly', or 'monthly'.
53
- #:file_rolling_age: weekly
54
-
55
- # Number of log files to keep
56
- #:file_rolling_keep: 6
57
-
58
- # Logging pattern for file-based loging
59
- #:file_logging_pattern: '%d %.8X{request} [%.1l] %m'
60
-
61
- # Logging pattern for syslog or journal loging
62
- #:system_logging_pattern: '%.8X{request} [%.1l] %m'
63
-
64
- # Maximum age of execution plans to keep before having them cleaned
65
- # by the execution plan cleaner (in seconds), defaults to 24 hours
66
- # :execution_plan_cleaner_age: 86400