* Bump cookbook version to 2.8

*  Add dependency on chef-sugar cookbook to provide platform helper methods (#162)

* Use platform methods from chef-sugar for guards in Xcode recipe

* Depend on chef-sugar cookbook for some added sugar

* Add El Capitan and an exception for an unsupported version

* Add version pinning for chef-sugar
  Co-Authored-By: ehanlon <eammon.hanlon@microsoft.com>

* Remove trailing whitespace

* update build badge

* add master parameter

* Fix for Issue #163 (#164)

* add additional check when grabbing the version

* add additional test with an incomplete list to see if library changes work

* Update libraries/command_line_tools.rb

Co-Authored-By: mjmerin <33106688+mjmerin@users.noreply.github.com>

* Update libraries/command_line_tools.rb

Co-Authored-By: mjmerin <33106688+mjmerin@users.noreply.github.com>

* Update spec/unit/libraries/command_line_tools_spec.rb

Co-Authored-By: mjmerin <33106688+mjmerin@users.noreply.github.com>

* fix unterminated string

* bump base box to the new 10.14.1

* added changlelog entry for release/2.8

* Update CHANGELOG.md

Co-Authored-By: v-anshie <v-anshie@microsoft.com>

* Update CHANGELOG.md

Co-Authored-By: v-anshie <v-anshie@microsoft.com>

* Update CHANGELOG.md

Co-Authored-By: v-anshie <v-anshie@microsoft.com>
This commit is contained in:
Eric Hanko 2018-11-20 12:04:31 -08:00 коммит произвёл Jacob Zaval
Родитель ac79dec338
Коммит d0751bca11
7 изменённых файлов: 47 добавлений и 8 удалений

Просмотреть файл

@ -62,14 +62,14 @@ platforms:
- name: mojave-chef13
driver:
box: microsoft/macos-mojave
version: 10.14.01
version: 10.14.1
provisioner:
product_version: 13
- name: mojave-chef14
driver:
box: microsoft/macos-mojave
version: 10.14.01
version: 10.14.1
provisioner:
product_version: 14

Просмотреть файл

@ -1,5 +1,11 @@
# Changelog
All notable changes to this project will be documented in this file.
## [2.8.0] - 2018-11-14
### Added
- Sugar helps the code go down! We now depend on [Chef Sugar](https://supermarket.chef.io/tools/chef-sugar) for `mac_os_x?`, `virtual?`, `mac_os_x_before_or_at_maverick?`, etc.
### Fixed
- Fixed an issue where Software Update Catalog provides an incomplete list causing some converge failures. We now check for `platform_specific.empty?` and produce appropriate errors.
## [2.7.0] - 2018-10-26
### Added

Просмотреть файл

@ -1,7 +1,7 @@
macOS Cookbook
==============
![build-status-badge](https://office.visualstudio.com/_apis/public/build/definitions/59d72877-1cea-4eb6-9d06-66716573631a/2791/badge)
[![Build status](https://dev.azure.com/office/APEX/_apis/build/status/lab/cookbooks/macos?branchName=master)](https://dev.azure.com/office/APEX/_build/latest?definitionId=2143)
Chef resources and recipes for managing and provisioning macOS.

Просмотреть файл

@ -10,7 +10,9 @@ module MacOS
FileUtils.chown 'root', 'wheel', install_sentinel
@version = if available.empty?
'Unavailable from Software Update Catalog'
'No Command Lines Tools available from Software Update Catalog!'
elsif platform_specific.empty?
"No Command Line Tools specific to #{macos_version} available from Software Update Catalog!"
else
latest.tr('*', '').strip
end

Просмотреть файл

@ -5,9 +5,11 @@ license 'MIT'
description 'Resources for configuring and provisioning macOS'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
chef_version '>= 13.0' if respond_to?(:chef_version)
version '2.7.0'
version '2.8.0'
source_url 'https://github.com/Microsoft/macos-cookbook'
issues_url 'https://github.com/Microsoft/macos-cookbook/issues'
supports 'mac_os_x'
depends 'chef-sugar', '~> 4.1'

Просмотреть файл

@ -1,11 +1,11 @@
if node['platform_version'].match? Regexp.union /10.14|10.13/
if mac_os_x_after_sierra?
execute 'Disable Gatekeeper' do
command ['spctl', '--master-disable']
end
xcode node['macos']['xcode']['version']
elsif node['platform_version'].match? Regexp.union '10.12'
elsif mac_os_x_sierra?
execute 'Disable Gatekeeper' do
command ['spctl', '--master-disable']
end
@ -14,8 +14,11 @@ elsif node['platform_version'].match? Regexp.union '10.12'
ios_simulators %w(11 10)
end
elsif node['platform_version'].match? Regexp.union '10.11'
elsif mac_os_x_el_capitan?
xcode '8.2.1' do
ios_simulators %w(10 9)
end
else
raise "#{node['platform_version']} is not supported."
end

Просмотреть файл

@ -30,6 +30,32 @@ describe MacOS::CommandLineTools do
end
end
context 'when provided an incomplete list of software update products in Mojave' do
before do
allow(FileUtils).to receive(:touch).and_return(true)
allow(FileUtils).to receive(:chown).and_return(true)
allow_any_instance_of(MacOS::CommandLineTools).to receive(:macos_version)
.and_return('10.14')
allow_any_instance_of(MacOS::CommandLineTools).to receive(:softwareupdate_list)
.and_return(["Software Update Tool\n",
"\n", "Finding available software\n",
"Software Update found the following new or updated software:\n",
" * Command Line Tools (macOS El Capitan version 10.11) for Xcode-8.2\n",
"\tCommand Line Tools (macOS El Capitan version 10.11) for Xcode (8.2), 150374K [recommended]\n",
" * Command Line Tools (macOS High Sierra version 10.13) for Xcode-10.0\n",
"\tCommand Line Tools (macOS High Sierra version 10.13) for Xcode (10.0), 190520K [recommended]\n",
" * Command Line Tools (macOS High Sierra version 10.13) for Xcode-9.3\n",
"\tCommand Line Tools (macOS High Sierra version 10.13) for Xcode (9.3), 187312K [recommended]\n",
" * Command Line Tools (macOS High Sierra version 10.13) for Xcode-9.4\n",
"\tCommand Line Tools (macOS High Sierra version 10.13) for Xcode (9.4), 187380K [recommended]\n"]
)
end
it 'returns the latest recommended Command Line Tools product' do
clt = MacOS::CommandLineTools.new
expect(clt.version).to eq 'No Command Line Tools specific to 10.14 available from Software Update Catalog!'
end
end
context 'when provided an available list of software update products in High Sierra' do
before do
allow(FileUtils).to receive(:touch).and_return(true)