brpm_content 0.1.30 → 0.1.31

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTNlODAyOTNlMTgwYmQ0NjE0MGE2MGYwYTQ5ODRlNzcxYmYxMGJlOQ==
4
+ ZTJiZWFjODgwMjJiZDhiNDE5MmE2YTE2NmVhNzY0NjkxOTc0YzY2ZA==
5
5
  data.tar.gz: !binary |-
6
- MDdlMGJhN2FkOGFhNzRiYjUwNTgxYWM5N2FmNmI1NjkwZmZmYzUxYg==
6
+ YTE5MTYxZGM5M2Q0YjMwY2JhMzRlOTc3MjQxYTE2ZGIzNzA4MjgwOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YmUzZGM0ODdlOTI3MjFkZDY1OTU0YzE5MmM5YzA0MzU5YzA2YmNkODA0NTI2
10
- MjQ2NDlkNjkwYTMwNTNjZmM1Mzc0MmVjMDAxNGI4YWQ2ZjQ5MDM3MzU4ZjM0
11
- NGY1NGRkNzNlZGQ5ZWY5ZmUwMmU5Zjc3YzUxZDg2N2ZiZjMyMjM=
9
+ MjUyNjMzZTUyMTE1NjZhNjg1MGQ1Y2FmYmY3MmVmZWNhMGZhZThlYjc1YTc4
10
+ NGE5NGYxMzcyNTMzZTIyYTMyNzkwY2QzYjBmODk3MWM3ZTEyMzk5ZGI0OWVk
11
+ ZGE4NGY4NGNkODI0NDRkNjM3MDJhZGEyNzAwZjIyNWY4M2E4YjI=
12
12
  data.tar.gz: !binary |-
13
- MzFkYzczMDY3YzMyNTI3Njc5NGFkM2ZmMzM1OGNlOGM3MzNkZjAwZjQ2ZjQ4
14
- ZWIzYmZhMzBkYWVlN2I1MzllZGM3Zjc3Yjc2YTEwMTc4MDhkZTdmOTM1YWE4
15
- YzMwNzkxNTE3ZDIxNzBhMTkwYTEwZTY4YTdmYzVkZTI4YTA1ZjA=
13
+ MmRmMjlhODJmNDY3YTU4OTgzYTcyOGY3MzY4ZTMwNWU5N2FhMWJkMWZhNGVi
14
+ MzNkMGZkYzA4NDBjZjc5ZjhkMTUyYzY3ZmQ5OTEzOTQxNzU2YzI0NDY4ZDY3
15
+ NjExNDE4MWQ3MjA5ZmIzZDZjZmMyOTE4Nzg3NzkyMjYyNGE3NDE=
@@ -1,4 +1,4 @@
1
- version: 0.1.30
1
+ version: 0.1.31
2
2
 
3
3
  author: Niek Bartholomeus
4
4
  email: niek.bartholomeus@gmail.com
@@ -14,8 +14,8 @@ class ModuleInstaller
14
14
  if brpm_content_spec and brpm_content_spec.version > Gem::Version.new(BrpmAuto.version)
15
15
  BrpmAuto.log "WARNING - A newer version of brpm_content was installed."
16
16
 
17
- BrpmAuto.log "Checking if the symlink to brpm_content-latest should be updated..."
18
- update_symlink_to_brpm_content_if_necessary(brpm_content_spec)
17
+ BrpmAuto.log "Updating the symlink to brpm_content-latest..."
18
+ update_symlink_to_brpm_content(brpm_content_spec)
19
19
 
20
20
  BrpmAuto.log "Copying the log.html file to te automation_results directory..."
21
21
  FileUtils.cp("#{brpm_content_spec.gem_dir}/modules/framework/log.html", "#{ENV["BRPM_HOME"]}/automation_results")
@@ -24,6 +24,10 @@ class ModuleInstaller
24
24
  BrpmAuto.log "Preparing the connectivity to BRPM..."
25
25
  if prepare_brpm_connection
26
26
  module_friendly_name = get_module_friendly_name(module_name)
27
+
28
+ BrpmAuto.log "Creating an automation error for '******** ERROR ********' if one doesn't exist yet..."
29
+ create_automation_error_if_not_exists("******** ERROR ********")
30
+
27
31
  BrpmAuto.log "Creating an automation category for #{module_friendly_name} if one doesn't exist yet..."
28
32
  create_automation_category_if_not_exists(module_friendly_name)
29
33
 
@@ -98,11 +102,11 @@ class ModuleInstaller
98
102
  end
99
103
  end
100
104
 
101
- def update_symlink_to_brpm_content_if_necessary(brpm_content_spec)
105
+ def update_symlink_to_brpm_content(brpm_content_spec)
102
106
  new_version_path = brpm_content_spec.gem_dir
103
107
  symlink_path = "#{ENV["GEM_HOME"]}/gems/brpm_content-latest"
104
108
 
105
- BrpmAuto.log "A newer version of brpm_content was installed so updating symlink #{symlink_path} to #{new_version_path}..."
109
+ BrpmAuto.log "Linking #{symlink_path} to #{new_version_path}..."
106
110
  result = BrpmAuto.execute_shell("ln -sfn #{new_version_path} #{symlink_path}")
107
111
  BrpmAuto.log result["stdout"] if result["stdout"] and !result["stdout"].empty?
108
112
  unless result["status"] == 0
@@ -118,6 +122,19 @@ class ModuleInstaller
118
122
  "#{module_name.sub("brpm_module_", "").capitalize}"
119
123
  end
120
124
 
125
+ def create_automation_error_if_not_exists(automation_error)
126
+
127
+ list_item = @brpm_rest_client.get_list_item_by_name("AutomationErrors", automation_error)
128
+
129
+ unless list_item
130
+ BrpmAuto.log "Automation error #{automation_error} doesn't exist yet, so creating it now..."
131
+ list_item = {}
132
+ list_item["list_id"] = @brpm_rest_client.get_list_by_name("AutomationErrors")["id"]
133
+ list_item["value_text"] = automation_error
134
+ @brpm_rest_client.create_list_item_from_hash(list_item)
135
+ end
136
+ end
137
+
121
138
  def create_automation_category_if_not_exists(module_friendly_name)
122
139
  list_item = @brpm_rest_client.get_list_item_by_name("AutomationCategory", module_friendly_name)
123
140
 
@@ -234,7 +251,7 @@ class ModuleInstaller
234
251
 
235
252
  script = {}
236
253
  script["name"] = auto_script_friendly_name
237
- script["description"] = auto_script_friendly_name
254
+ script["description"] = auto_script_config["description"] || ""
238
255
  script["automation_type"] = automation_type
239
256
  script["automation_category"] = module_friendly_name
240
257
  script["content"] = wrapper_script_content
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brpm_content
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.30
4
+ version: 0.1.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Niek Bartholomeus
@@ -277,10 +277,10 @@ files:
277
277
  - modules/email/automations/send_notification.rb
278
278
  - modules/email/automations/send_notification.txt
279
279
  - modules/email/config.yml
280
+ - modules/framework/automations/direct_execute.meta
280
281
  - modules/framework/automations/direct_execute.rb
281
- - modules/framework/automations/direct_execute.txt
282
+ - modules/framework/automations/install_module.meta
282
283
  - modules/framework/automations/install_module.rb
283
- - modules/framework/automations/install_module.txt
284
284
  - modules/framework/bin/brpm_install
285
285
  - modules/framework/bin/event_handler
286
286
  - modules/framework/bin/webhook_receiver