kitchen-appbundle-updater 0.0.1 → 0.0.2

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
  SHA1:
3
- metadata.gz: 4edecac847c0d47ba64b91b40a1a84ea11a5b679
4
- data.tar.gz: 6854a9d9644a6edfc3538be24c670d04decee392
3
+ metadata.gz: 46cd007bbb427b32be4a64bac18dbf7bc50cbdd5
4
+ data.tar.gz: b86380f73b90f264c48b8f0ab4ef278cd50acd0e
5
5
  SHA512:
6
- metadata.gz: 2f114548d308685eeed284a5d008dc2b59caca61453637a59c1ddbf79e3663e30381ad41c819321254cdf2e49fda2b75ff199b6a9688c7d33c2394451b9f9654
7
- data.tar.gz: 0edc59609924a473c01b8a96283700b7a4b37c70c2a07c9bb1a94845344df524d7bdd2905dd5ee84f1ddfd2df03bbd042fc2400db48227c03ece8bb458246a27
6
+ metadata.gz: f8c88d57b3c68f8bb8e4fb1bd435724495b67bbaf4f337435b76206543ea71a8d9645fddbc9681c77b23b97e6b829383ad9a27d6fa24eb128a49391ecee01f0f
7
+ data.tar.gz: b6bc22049a30565509d23d9df2749d38997bf2a3e912cdb87a640c8b8b8b4c34b49985b682349b01a9639c85c91c6a74fbd9a7f90dcfe3f06a1443bb0a92deb1
@@ -1,3 +1,3 @@
1
1
  class KitchenAppbundleUpdater
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
@@ -23,6 +23,13 @@ module Kitchen
23
23
  end
24
24
  end
25
25
 
26
+ def latest_chef_appbundle_updater
27
+ @cookbook_url ||= open("https://api.github.com/repos/jdmundrawala/chef-appbundle-updater/releases/latest") do |r|
28
+ j = JSON.parse(r.read)
29
+ j["assets"][0]["browser_download_url"]
30
+ end
31
+ end
32
+
26
33
  def prepare_command
27
34
  [
28
35
  prepare_command_vars,
@@ -32,6 +39,7 @@ module Kitchen
32
39
 
33
40
  def prepare_command_vars
34
41
  vars = [
42
+ shell_var("cookbook_url", latest_chef_appbundle_updater),
35
43
  shell_var("json", File.join(config[:root_path], 'dna_updater.json')),
36
44
  shell_var("chef_omnibus_root", config[:chef_omnibus_root]),
37
45
  ]
@@ -4,7 +4,5 @@ Function Log($m) { Write-Host " $m`n" }
4
4
 
5
5
  Log "Finding cookbook to update chef"
6
6
  $env:Path = $env:Path + ";$chef_omnibus_root\bin\"
7
- $response = Invoke-WebRequest "https://api.github.com/repos/jdmundrawala/chef-appbundle-updater/releases/latest"
8
- $url = ($response.Content | ConvertFrom-Json).assets[0].browser_download_url
9
- Log "Running chef-client with recipe chef-appbundle-updater::default from $url"
10
- & "$chef_omnibus_root\bin\chef-client.bat" -z --recipe-url "$url" -j "$json" -o "recipe[chef-appbundle-updater::default]"
7
+ Log "Running chef-client with recipe chef-appbundle-updater::default from $cookbook_url"
8
+ & "$chef_omnibus_root\bin\chef-client.bat" -z --recipe-url "$cookbook_url" -j "$json" -o "recipe[chef-appbundle-updater::default]"
@@ -2,9 +2,7 @@ set -e
2
2
 
3
3
  # main
4
4
  main() {
5
- url=`curl -s "https://api.github.com/repos/jdmundrawala/chef-appbundle-updater/releases/latest" | \
6
- "$chef_omnibus_root/embedded/bin/ruby" -rjson -e 'j=JSON.parse(STDIN.read); puts j["assets"][0]["browser_download_url"]'`
7
- sudo "$chef_omnibus_root/bin/chef-client" -z --recipe-url "$url" -j "$json" -o "recipe[chef-appbundle-updater::default]"
5
+ sudo "$chef_omnibus_root/bin/chef-client" -z --recipe-url "$cookbook_url" -j "$json" -o "recipe[chef-appbundle-updater::default]"
8
6
  }
9
7
 
10
8
  # augment path in an attempt to find a download program
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-appbundle-updater
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Mundrawala
@@ -128,4 +128,3 @@ signing_key:
128
128
  specification_version: 4
129
129
  summary: A Test Kitchen Driver for Appbundle-updater
130
130
  test_files: []
131
- has_rdoc: