brpm_content_framework 0.2.63 → 0.2.64
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 +8 -8
- data/README.md +1 -0
- data/config.yml +1 -1
- data/infrastructure/scripts/patch_brpm.sh +0 -1
- data/infrastructure/scripts/run_webhook_receiver.sh +1 -3
- data/lib/brpm_script_executor.rb +3 -2
- data/lib/params/all_params.rb +8 -0
- data/lib/params/request_params.rb +5 -2
- data/tests/all_params_spec.rb +32 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
NmRiNWUyNGVkNzQwZmQ3MjYwYjI0ZTkxMTg5NWY4M2U4MDgyNzg0ZA==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
MGQxM2EzZWZhOWI5OWU1YzA2OGMzOGQ1Y2FhMzFkOTY0ZmY5YTAwYQ==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
ZmQ4NTc3ZDg3OGI2YTFiMTQwMjMyMmZjOGZhYTNiMjNjNTBiYzNmN2E4YTM5
|
|
10
|
+
Njg0N2RkMGNiMzM5NTNkZDRkMmQ2ODllODkyOTlhODdhNzE5ZDJjZTI1Yjg4
|
|
11
|
+
YTMxNjkzYWYxNWJmM2JmNmIyMWNiOTQ4N2NhOWJjODA3ZDhmMWE=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
OWNiYWRkZGM3MjExMGQxOTJkYzA3ZmJlZGFmZjdiNWI1YWVkNzFmYTI0ZDhl
|
|
14
|
+
NjhlOGMxY2NhN2MyMTdmYWE1OWY1NTEyYmQyZGRlZTkzMGM2YWIwMTljZmQ0
|
|
15
|
+
NzE1N2VhNDUzZWUyNTYzZWFkM2FhZGYyMzVlOWE5MDNhYTAwMTA=
|
data/README.md
CHANGED
|
@@ -368,5 +368,6 @@ For an example of how to update the status of the associated JIRA tickets after
|
|
|
368
368
|
### [JIRA](https://github.com/BMC-RLM/brpm_module_jira)
|
|
369
369
|
### [Jenkins](https://github.com/BMC-RLM/brpm_module_jenkins)
|
|
370
370
|
### [Ansible](https://github.com/BMC-RLM/brpm_module_ansible)
|
|
371
|
+
### [ServiceNow](https://github.com/BMC-RLM/brpm_module_servicenow)
|
|
371
372
|
### [Demo customer](https://github.com/BMC-RLM/brpm_module_demo)
|
|
372
373
|
|
data/config.yml
CHANGED
|
@@ -52,7 +52,6 @@ unzip -d $BRPM_HOME/releases/$NEW_VERSION/RPM $BRPM_HOME/releases/$NEW_VERSION/R
|
|
|
52
52
|
echo "Copying over the config files from $BRPM_HOME/releases/$OLD_VERSION/RPM/config ..."
|
|
53
53
|
/bin/cp $BRPM_HOME/releases/$OLD_VERSION/RPM/config/database.yml $BRPM_HOME/releases/$NEW_VERSION/RPM/config
|
|
54
54
|
/bin/cp $BRPM_HOME/releases/$OLD_VERSION/RPM/config/automation_settings.rb $BRPM_HOME/releases/$NEW_VERSION/RPM/config
|
|
55
|
-
/bin/cp $BRPM_HOME/releases/$OLD_VERSION/RPM/config/smtp_settings.rb $BRPM_HOME/releases/$NEW_VERSION/RPM/config
|
|
56
55
|
/bin/cp $BRPM_HOME/releases/$OLD_VERSION/RPM/config/wicked_pdf_config.rb $BRPM_HOME/releases/$NEW_VERSION/RPM/config
|
|
57
56
|
/bin/cp $BRPM_HOME/releases/$OLD_VERSION/RPM/config/carrierwave_settings.rb $BRPM_HOME/releases/$NEW_VERSION/RPM/config
|
|
58
57
|
|
|
@@ -3,13 +3,11 @@
|
|
|
3
3
|
export WEBHOOK_RECEIVER_PORT=8089
|
|
4
4
|
export WEBHOOK_RECEIVER_MOUNT_POINT=webhooks
|
|
5
5
|
export WEBHOOK_RECEIVER_LOG_FILE=/tmp/webhook_receiver.log
|
|
6
|
-
export
|
|
7
|
-
export WEBHOOK_RECEIVER_PROCESS_EVENT_SCRIPT=integrations/jira/process_webhook_event.rb
|
|
6
|
+
export WEBHOOK_RECEIVER_PROCESS_EVENT_SCRIPT=integrations/xxx/process_webhook_event.rb
|
|
8
7
|
|
|
9
8
|
# custom settings
|
|
10
9
|
export WEBHOOK_RECEIVER_BRPM_HOST=localhost
|
|
11
10
|
export WEBHOOK_RECEIVER_BRPM_PORT=8088
|
|
12
11
|
export WEBHOOK_RECEIVER_BRPM_TOKEN=???
|
|
13
|
-
export WEBHOOK_RECEIVER_JIRA_RELEASE_FIELD_ID=???
|
|
14
12
|
|
|
15
13
|
webhook_receiver
|
data/lib/brpm_script_executor.rb
CHANGED
|
@@ -118,11 +118,11 @@ EOR
|
|
|
118
118
|
FileUtils.rm(params_path) if File.exists?(params_path)
|
|
119
119
|
|
|
120
120
|
unless result["status"] == 0
|
|
121
|
-
BrpmAuto.log "stdout:#{result["stdout"]}"
|
|
121
|
+
BrpmAuto.log "stdout from the executed script:#{result["stdout"]}"
|
|
122
122
|
raise "The process failed with status #{result["status"]}.\n#{result["stderr"]}"
|
|
123
123
|
end
|
|
124
124
|
|
|
125
|
-
BrpmAuto.log "The process finished
|
|
125
|
+
BrpmAuto.log "The process finished successfully."
|
|
126
126
|
|
|
127
127
|
if automation_type == "resource_automation"
|
|
128
128
|
result_path = params_path.sub!("params", "result")
|
|
@@ -162,6 +162,7 @@ EOR
|
|
|
162
162
|
end
|
|
163
163
|
|
|
164
164
|
result = execute_automation_script_internal(modul, name, params, automation_type, parent_id, offset, max_records)
|
|
165
|
+
|
|
165
166
|
if automation_type == "resource_automation"
|
|
166
167
|
result_file = params_file.sub("params", "result")
|
|
167
168
|
BrpmAuto.log " Temporarily storing the result to #{result_file}..."
|
data/lib/params/all_params.rb
CHANGED
|
@@ -17,6 +17,14 @@ class AllParams < ParamsBase
|
|
|
17
17
|
raise RuntimeError.new("This is a virtual hash based on two physical hashes, use the add method instead.")
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
+
def [](key)
|
|
21
|
+
if @params[key] and ! @params[key].empty?
|
|
22
|
+
@params[key]
|
|
23
|
+
else
|
|
24
|
+
@request_params[key]
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
20
28
|
#TODO: refactor out the where functionality
|
|
21
29
|
# Test if a param is present
|
|
22
30
|
#
|
|
@@ -6,11 +6,14 @@ class RequestParams < ParamsBase
|
|
|
6
6
|
def initialize(path)
|
|
7
7
|
@file_path = "#{path}/request_data.json"
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
if File.exist?(@file_path)
|
|
10
|
+
BrpmAuto.log "Loading the request params from #{@file_path}..."
|
|
11
|
+
self.merge!(get_request_params)
|
|
12
|
+
end
|
|
10
13
|
end
|
|
11
14
|
|
|
12
15
|
def self.new_for_request(automation_results_dir, app_name, request_id)
|
|
13
|
-
self.new("#{automation_results_dir}/request/#{app_name}/#{request_id}")
|
|
16
|
+
self.new("#{automation_results_dir}/request/#{app_name.gsub(" ", "_")}/#{request_id}")
|
|
14
17
|
end
|
|
15
18
|
|
|
16
19
|
def []=(key,val)
|
data/tests/all_params_spec.rb
CHANGED
|
@@ -18,8 +18,11 @@ describe 'All params' do
|
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
it 'should get a param from the request_param store' do
|
|
21
|
+
input_request_params = {}
|
|
22
|
+
input_request_params["key1"] = "value1"
|
|
23
|
+
set_request_params(input_request_params)
|
|
24
|
+
|
|
21
25
|
input_params = get_default_params
|
|
22
|
-
input_params["key1"] = "value1"
|
|
23
26
|
|
|
24
27
|
BrpmAuto.setup(input_params)
|
|
25
28
|
all_params = BrpmAuto.all_params
|
|
@@ -28,6 +31,34 @@ describe 'All params' do
|
|
|
28
31
|
expect(all_params["key1"]).to eql("value1")
|
|
29
32
|
end
|
|
30
33
|
|
|
34
|
+
it 'should get a param from the param store if a param with the same name exists in the param and the request_param store' do
|
|
35
|
+
input_request_params = {}
|
|
36
|
+
input_request_params["key1"] = "value1"
|
|
37
|
+
set_request_params(input_request_params)
|
|
38
|
+
|
|
39
|
+
input_params = get_default_params
|
|
40
|
+
input_params["key1"] = "value2"
|
|
41
|
+
|
|
42
|
+
BrpmAuto.setup(input_params)
|
|
43
|
+
all_params = BrpmAuto.all_params
|
|
44
|
+
|
|
45
|
+
expect(all_params["key1"]).to eql("value2")
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
it 'should get a param from the request param store if a param with the same name exists in the param and the request_param store but the one from the param store is empty' do
|
|
49
|
+
input_request_params = {}
|
|
50
|
+
input_request_params["key1"] = "value1"
|
|
51
|
+
set_request_params(input_request_params)
|
|
52
|
+
|
|
53
|
+
input_params = get_default_params
|
|
54
|
+
input_params["key1"] = ""
|
|
55
|
+
|
|
56
|
+
BrpmAuto.setup(input_params)
|
|
57
|
+
all_params = BrpmAuto.all_params
|
|
58
|
+
|
|
59
|
+
expect(all_params["key1"]).to eql("value1")
|
|
60
|
+
end
|
|
61
|
+
|
|
31
62
|
it 'should get a param by the get method' do
|
|
32
63
|
input_params = get_default_params
|
|
33
64
|
input_params["key1"] = "value1"
|
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.64
|
|
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-11-
|
|
11
|
+
date: 2015-11-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|