brpm_content 0.1.45 → 0.1.46

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
- MWM5Yjc2NzlmMDcyMTQ1YmIwMDIxODI4OWNiNTZmNDAyMGRlYWI1ZA==
4
+ MmMzMmVhMDQ0MzMzZTdlZTU5MDYzNGYxNWRjNzgzMzBkZTU3NTBhNg==
5
5
  data.tar.gz: !binary |-
6
- YWJhNjJiZGUzYTgyNmI4MjZkMTk2MjYwNjU1M2MyZDExZTI0NDJiMQ==
6
+ NWZkMTlhOTgwOWI5OWIwYjFjZDUzYzYwY2E0MGJhNzg4MjM4ODE3Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OTU4NDAyZGE3NzdmYzIyOGYxMTdjYTIxMGNiMDZiZjdhYzU4OTIzYjU4Njgw
10
- OWQ5OTkxMTgwNDYwNGI5NTcyZGNjNTY0MWRhMTdmMGM0YjYyMTY0Yjc4ZDE1
11
- YjNkN2NhOTVkMjIxMWUxMmYwZDA2NmIwZDlkOWNiMGY0ZjU1MDY=
9
+ MzcyZWZlNGQxMTY0YTgwYzhlMDYxZTMyNjQwNDM3NjA4Njg2NjdiNDc4OWVm
10
+ N2E2NDAwOTAzNGE0ZmIwNWIxMmY3YTY0YTlkMGE2ZDc4ZTNhNzBiNmMwM2Ux
11
+ Njg4N2I4ZDUwNDM5ZWVkYjEzZDdkMjFiZjI4YzU4ODhiNjA1NzI=
12
12
  data.tar.gz: !binary |-
13
- NzdkMWU0M2IwMjE2MDcxZjFkYTJkODVmMzk3ZTgwMWJmZjI1YWVhNmJhZTc3
14
- ZTU0NzE4ZjdkYmU2ZjliZDY0NzRkNzhjNzE2NTJlMWM2YWU1MjhmZTU5MmY1
15
- MTQ4Y2UwNWZjNGUwNzEzYjRmZGZmNWIxNjI3YjBkNzBhYTM5MTk=
13
+ ZjIwZjIzYmFiMTUwN2M1NDI3ZmVmOGM4M2Q0YTliMjE1YjBlM2E2NjY3MWJh
14
+ MjdlNmNkYjljNTAyY2ZjNjBlNWU4NTY5OGJlZjc5NzgyNDc0ODU2Njg2Mjgz
15
+ OTA3MTZhOGQ4ZDc2MGNiMzMzMDQwNDViZWU3M2M4NGYxM2U1ZjM=
data/.travis.yml CHANGED
@@ -5,8 +5,6 @@ rvm:
5
5
  before_install:
6
6
  - gem update --system 2.1.9
7
7
 
8
- install: gem install brpm_module_brpm #needed for module installation tests
9
-
10
8
  script:
11
9
  - rspec modules/framework/tests --format documentation --color
12
10
 
data/config.yml CHANGED
@@ -1,4 +1,4 @@
1
- version: 0.1.45
1
+ version: 0.1.46
2
2
 
3
3
  author: Niek Bartholomeus
4
4
  email: niek.bartholomeus@gmail.com
@@ -89,8 +89,10 @@ class ModuleInstaller
89
89
  end
90
90
  end
91
91
 
92
- BrpmAuto.log "Uninstalling module #{module_name}#{module_version.nil? ? "" : " " + module_version}..."
93
- `gem uninstall #{module_name}#{module_version.nil? ? "" : " -v " + module_version}`
92
+ unless ENV["TRAVIS"] == "true" #TODO: make this work on the travisci server
93
+ BrpmAuto.log "Uninstalling module #{module_name}#{module_version.nil? ? "" : " " + module_version}..."
94
+ BrpmAuto.log `gem uninstall #{module_name}#{module_version.nil? ? "" : " -v " + module_version}`
95
+ end
94
96
 
95
97
  return true
96
98
  end
@@ -358,6 +360,22 @@ class ModuleInstaller
358
360
  script_to_update["aasm_state"] = "released"
359
361
  script = @brpm_rest_client.update_script_from_hash(script_to_update)
360
362
  end
363
+
364
+ if script["aasm_state"] == "archived_state"
365
+ BrpmAuto.log "Updating the aasm_state of the wrapper script to 'released'..."
366
+ script_to_update = {}
367
+ script_to_update["id"] = script["id"]
368
+ script_to_update["aasm_state"] = "retired"
369
+ script = @brpm_rest_client.update_script_from_hash(script_to_update)
370
+ end
371
+
372
+ if script["aasm_state"] == "retired"
373
+ BrpmAuto.log "Updating the aasm_state of the wrapper script to 'released'..."
374
+ script_to_update = {}
375
+ script_to_update["id"] = script["id"]
376
+ script_to_update["aasm_state"] = "released"
377
+ script = @brpm_rest_client.update_script_from_hash(script_to_update)
378
+ end
361
379
  end
362
380
 
363
381
  def uninstall_auto_script_wrapper(auto_script_path, automation_type, module_friendly_name)
@@ -2,6 +2,7 @@ require_relative "spec_helper"
2
2
 
3
3
  describe 'Module installer' do
4
4
  before(:all) do
5
+ BrpmAuto.log "Creating ~/.brpm file..."
5
6
  create_brpm_file
6
7
  setup_brpm_auto
7
8
  end
@@ -49,14 +49,16 @@ def decrypt_string_with_prefix(input) # mocked method
49
49
  end
50
50
 
51
51
  def create_brpm_file
52
- unless File.exists?("~/.brpm")
53
- params = get_default_params
54
- brpm_params = {}
55
- brpm_params["brpm_url"] = params["brpm_url"]
56
- brpm_params["brpm_api_token"] = params["brpm_api_token"]
57
-
58
- File.open(File.expand_path("~/.brpm"), "w") do |file|
59
- file.puts(brpm_params.to_yaml)
60
- end
52
+ if File.exists?("~/.brpm")
53
+ FileUtils.rm("~/.brpm")
54
+ end
55
+
56
+ params = get_default_params
57
+ brpm_params = {}
58
+ brpm_params["brpm_url"] = params["brpm_url"]
59
+ brpm_params["brpm_api_token"] = params["brpm_api_token"]
60
+
61
+ File.open(File.expand_path("~/.brpm"), "w") do |file|
62
+ file.puts(brpm_params.to_yaml)
61
63
  end
62
64
  end
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.45
4
+ version: 0.1.46
5
5
  platform: ruby
6
6
  authors:
7
7
  - Niek Bartholomeus