boxes 3.0.0 → 3.1.0

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: eef35d51a88c6a6f90d351125b40067ae67520bf
4
- data.tar.gz: d583221915286eefd13de1b3ae90103d28dd0ea8
3
+ metadata.gz: 52086e8025e436389b24a3277ade1e64078120c0
4
+ data.tar.gz: 0bca9ac72bc3a4d5a27837d55384233533395d83
5
5
  SHA512:
6
- metadata.gz: b9b66d0a3bce4a64ed8b85c314f56cf74d88eba95617017875de482b3a8cc71942e874c8aa5c3ea83d31e315abaf22a6e7bbd97bceb2b952368bb801884a3a2f
7
- data.tar.gz: 96f92de5281e31ce9fed58de4e5f865ef9c65938591a69f70df9a96fecd6558d3ad4c4c8272cc1925859edd5791c895715a4ba502dd1ae1bd41fc134a3c3c575
6
+ metadata.gz: bc189c6e439afc17c59348315a88854c74e1ec22a009a16194a9c0916e230d635e2bd5f5e4a7b7bf77f7705a8c8650b6fb95898653677b8a9a1e461712027980
7
+ data.tar.gz: edaf1b9d08f12f9fc063fc9c2379b115fcd4b6b2f9edabeef45ed449986a094f5e79c00882ddcdc4e89e213ecabd6caf171bcb1358639f91ae7e54b82a315497
@@ -1,5 +1,13 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 3.1.0 (08/04/2018)
4
+
5
+ * Switch to use the Boxes Metadata API for Chef ([52]).
6
+ * Fix Puppet deb installation ([51])
7
+
8
+ [51]: https://github.com/nickcharlton/boxes/pull/51
9
+ [52]: https://github.com/nickcharlton/boxes/pull/52
10
+
3
11
  ## 3.0.0 (05/02/2018)
4
12
 
5
13
  * Update scripts/ruby.sh to follow ruby-lang.org current Rubies ([48]).
@@ -1,3 +1,3 @@
1
1
  module Boxes
2
- VERSION = "3.0.0".freeze
2
+ VERSION = "3.1.0".freeze
3
3
  end
@@ -1,28 +1,43 @@
1
1
  #!/bin/bash
2
2
 
3
- # Get the Chef package version through their metadata service.
3
+ # Fetches the Chef package version and sha from the Boxes API, then installs
4
+ # the package.
5
+
6
+ set -e
7
+
8
+ boxes_api="https://boxes.io/api/v1"
4
9
  platform=$(lsb_release -si | tr '[:upper:]' '[:lower:]')
5
10
  release=$(lsb_release -sr)
6
- version_url="https://www.opscode.com/chef/metadata?v=&prerelease=false&nightlies=false&p=$platform&pv=$release&m=x86_64"
7
- current_version=$(curl -s "$version_url")
8
11
 
9
- version_url=$(echo "$current_version" | awk '/url/{print $2}')
10
- version_sha=$(echo "$current_version" | awk '/sha256/{print $2}')
12
+ if [ "$platform" == "debian" ]; then
13
+ release=$(echo "$release" | cut -d. -f1)
14
+ fi
15
+
16
+ version_url="$boxes_api/metadata/chef?platform=$platform&platform_version=$release"
17
+
18
+ echo "Determining current Chef package version..."
19
+ if ! current_version=$(curl --silent --fail "${version_url}"); then
20
+ >&2 echo "Unable to fetch version information for $platform, $release"
21
+ exit 1
22
+ fi
23
+
24
+ version_url=$(echo "$current_version" | python -c \
25
+ "import json,sys;obj=json.load(sys.stdin);print obj['url'];")
26
+ version_sha=$(echo "$current_version" | python -c \
27
+ "import json,sys;obj=json.load(sys.stdin);print obj['sha256'];")
11
28
 
12
- # fetch chef
13
- curl --insecure --location $version_url -o chef.deb
29
+ echo "Fetching Chef package..."
30
+ curl --silent --fail "$version_url" -o chef.deb
14
31
 
15
- # check the file
16
- echo "$version_sha chef.deb" > '/tmp/chef-checksum'
17
- shasum -a 256 -c '/tmp/chef-checksum'
18
- if [ $? -ne 0 ]; then
19
- echo "Downloaded Chef package failed to checksum."
20
- exit 1
32
+ echo "Verifying downloaded Chef package..."
33
+ downloaded_sha=$(openssl sha256 -r chef.deb)
34
+ if [ "$version_sha *chef.deb" != "$downloaded_sha" ]; then
35
+ >&2 echo "Unable to verify downloaded chef.deb"
36
+ echo 2
21
37
  fi
22
38
 
23
- # install
24
- dpkg -i chef.deb
39
+ echo "Installing Chef package..."
40
+ dpkg --install chef.deb
25
41
 
26
- # cleanup
42
+ echo "Tidying up artifacts..."
27
43
  rm chef.deb
28
- rm /tmp/chef-checksum
@@ -1,14 +1,11 @@
1
1
  #!/bin/bash
2
2
 
3
- # see: http://docs.puppetlabs.com/guides/puppetlabs_package_repositories.html
3
+ # see: https://docs.puppet.com/puppet/latest/puppet_platform.html
4
4
 
5
5
  # determine the os release
6
6
  os_release=$(lsb_release -cs)
7
7
 
8
8
  # configure the puppet package sources
9
- wget http://apt.puppetlabs.com/puppetlabs-release-$os_release.deb
10
- dpkg -i puppetlabs-release-$os_release.deb
9
+ wget "https://apt.puppet.com/puppet5-release-$os_release.deb"
10
+ dpkg -i "puppet5-release-$os_release.deb"
11
11
  apt-get -q update
12
-
13
- # install puppet
14
- apt-get install -qy puppet
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boxes
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Charlton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-05 00:00:00.000000000 Z
11
+ date: 2018-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: claide