brpm_content_framework 0.2.17 → 0.2.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +3 -1
- data/config.yml +1 -1
- data/lib/brpm_script_executor.rb +10 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjY5YmEwNzU4M2E3NjI1ZGRlZWU3YTBiZWQxMjM2ZTNhZmM5NGY4YQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MjExNWRhNDA4OTNiZjUwMzZjMjY2Mzk3OGU1NmJhODJkNTU2ODkwOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MDM0NzVjZjY0YTA3MmQ4MmNlZDZjZDM2MzNjOGExMWQ0YjNmZTM3MzNjMDhl
|
10
|
+
ZWNmNTEyOGM1NWM5ZmQ0M2QzYmFlMjFkNTg4ZjAwNDY3NjYwOTRmNmYzMzYy
|
11
|
+
OTE0OGEzMWUxOGYzZmU3MDAzZDQzMDUwZGVmOGYzMjc2NjdkMTk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGNkYjI3MmFkMTcyZWY2ZjM2M2VlMjIwNWY3NDA4N2YyNmIxZTdhNGQ1Mjcy
|
14
|
+
YmIyZjU2ZWJlMmEyMDRmNzc0MzM3YjQ4MGUxMDliZGU3ZTIxMGM3MzRmNDA5
|
15
|
+
MGFkNTE2OTE1ZDg2MDE1Yzc4NTk2NTdiOGI3MTQxMDRlMjA4ZjU=
|
data/README.md
CHANGED
@@ -116,9 +116,11 @@ The config.yml file contains the meta data of the module as well as a list of th
|
|
116
116
|
|
117
117
|
The automations directory contains the actual automation scripts and the resource_automations directory contains the resource automation scripts. For each of these scripts a meta file must exist that contains (you guessed it right) the meta data of the automation script.
|
118
118
|
|
119
|
+
You can optionally include a Gemfile to your module. This will make sure that the versions of the modules (and other gems) that your module depends on are pinned during the installation of your module, even if more recent versions of these dependencies are installed later on. If you include a Gemfile.lock to the module (automatically generated when you do a 'bundle install') you can even pin these versions during build time. This will make sure that your module uses the same versions of the dependencies wherever and whenever it is installed. If you don't include any of these files then the latest available version of the dependent modules is automatically used.
|
120
|
+
|
119
121
|
See the example files from the module_template directory for more information on the mandatory and optional fields.
|
120
122
|
|
121
|
-
In order to publish your module,
|
123
|
+
In order to publish your module, two more files are needed: a module.gemspec file and a Rakefile. These files can be copied from the module_template directory unmodified.
|
122
124
|
|
123
125
|
During the development life cycle, after you have committed the changes to your automation scripts and bumped the version number from the config.yml file, you can now publish the new version of your module with a simple command:
|
124
126
|
```shell
|
data/config.yml
CHANGED
data/lib/brpm_script_executor.rb
CHANGED
@@ -16,8 +16,11 @@ class BrpmScriptExecutor
|
|
16
16
|
|
17
17
|
def execute_automation_script_in_separate_process_internal(modul, name, params, automation_type, parent_id = nil, offset = nil, max_records = nil)
|
18
18
|
BrpmAuto.setup(params)
|
19
|
+
BrpmAuto.log ""
|
20
|
+
BrpmAuto.log "Executing #{automation_type} '#{name}' from module '#{modul}' in a separate process..."
|
19
21
|
|
20
22
|
env_vars = {}
|
23
|
+
env_vars["JRUBY_OPTS"] = "-Xcompile.invokedynamic=false -J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -J-noverify -Xcompile.mode=OFF" # improve jvm startup time (see http://rexchung.com/2013/08/02/speed-up-jruby-rails-startup-time/)
|
21
24
|
env_vars["GEM_HOME"] = ENV["BRPM_CONTENT_HOME"] || "#{ENV["BRPM_HOME"]}/modules"
|
22
25
|
|
23
26
|
BrpmAuto.log "Finding the module path..."
|
@@ -55,7 +58,7 @@ class BrpmScriptExecutor
|
|
55
58
|
file.puts(params.to_yaml)
|
56
59
|
end
|
57
60
|
|
58
|
-
BrpmAuto.log "Executing
|
61
|
+
BrpmAuto.log "Executing the script in a separate process..."
|
59
62
|
return_value = Bundler.clean_system(env_vars, RbConfig.ruby, "-e", "#{require_bundler}require 'brpm_script_executor'; BrpmScriptExecutor.execute_automation_script_from_other_process(\"#{modul}\", \"#{name}\", \"#{params_file}\", \"#{automation_type}\", \"#{parent_id}\", \"#{offset}\", \"#{max_records}\")")
|
60
63
|
FileUtils.rm(params_file) if File.exists?(params_file)
|
61
64
|
if return_value.nil?
|
@@ -87,18 +90,19 @@ class BrpmScriptExecutor
|
|
87
90
|
params = YAML.load_file(params_file)
|
88
91
|
FileUtils.rm(params_file)
|
89
92
|
|
90
|
-
puts "Setting up the BRPM Content framework..."
|
93
|
+
puts " Setting up the BRPM Content framework..."
|
91
94
|
BrpmAuto.setup(params)
|
95
|
+
BrpmAuto.log " BRPM Content framework is version #{BrpmAuto.version}."
|
92
96
|
|
93
97
|
if BrpmAuto.params["SS_run_key"] and BrpmAuto.params["SS_script_support_path"]
|
94
|
-
|
98
|
+
BrpmAuto.log " Loading the BRPM core framework's libraries..."
|
95
99
|
load File.expand_path("#{File.dirname(__FILE__)}/../infrastructure/create_output_file.rb")
|
96
100
|
end
|
97
101
|
|
98
102
|
result = execute_automation_script_internal(modul, name, params, automation_type, parent_id, offset, max_records)
|
99
103
|
if automation_type == "resource_automation"
|
100
104
|
result_file = "#{File.dirname(params_file)}/result_#{Process.pid}.yml"
|
101
|
-
BrpmAuto.log "Temporarily storing the result to #{result_file}..."
|
105
|
+
BrpmAuto.log " Temporarily storing the result to #{result_file}..."
|
102
106
|
FileUtils.rm(result_file) if File.exists?(result_file)
|
103
107
|
File.open(result_file, "w") do |file|
|
104
108
|
file.puts(result.to_yaml)
|
@@ -119,7 +123,7 @@ class BrpmScriptExecutor
|
|
119
123
|
BrpmAuto.setup(params)
|
120
124
|
|
121
125
|
BrpmAuto.log ""
|
122
|
-
BrpmAuto.log ">>>>>>>>>>>>>> START #{automation_type} #{name}"
|
126
|
+
BrpmAuto.log ">>>>>>>>>>>>>> START #{automation_type} #{modul} #{name}"
|
123
127
|
start_time = Time.now
|
124
128
|
|
125
129
|
module_spec = Gem::Specification.find_by_name(modul) # will raise an error when the module is not installed
|
@@ -136,7 +140,6 @@ class BrpmScriptExecutor
|
|
136
140
|
load automation_script_path
|
137
141
|
|
138
142
|
if automation_type == "resource_automation"
|
139
|
-
BrpmAuto.log "Calling execute_resource_automation_script(params, parent_id, offset, max_records)..."
|
140
143
|
execute_script(params, parent_id, offset, max_records)
|
141
144
|
end
|
142
145
|
rescue Exception => e
|
@@ -149,7 +152,7 @@ class BrpmScriptExecutor
|
|
149
152
|
duration = 0
|
150
153
|
duration = stop_time - start_time unless start_time.nil?
|
151
154
|
|
152
|
-
BrpmAuto.log ">>>>>>>>>>>>>> STOP #{automation_type} #{name} - total duration: #{Time.at(duration).utc.strftime("%H:%M:%S")}"
|
155
|
+
BrpmAuto.log ">>>>>>>>>>>>>> STOP #{automation_type} #{modul} #{name} - total duration: #{Time.at(duration).utc.strftime("%H:%M:%S")}"
|
153
156
|
BrpmAuto.log ""
|
154
157
|
|
155
158
|
#load File.expand_path("#{File.dirname(__FILE__)}/../infrastructure/write_to.rb") if BrpmAuto.params.run_from_brpm
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brpm_content_framework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Niek Bartholomeus
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|