cookbook 'mac-app-store', '= 2.1.0'
mac-app-store (13) Versions 2.1.0 Follow7
Automates installation of Mac App Store apps
cookbook 'mac-app-store', '= 2.1.0', :supermarket
knife supermarket install mac-app-store
knife supermarket download mac-app-store
Mac App Store Cookbook
A Chef cookbook for installation of Mac App Store apps via the
Mas CLI tool.
Requirements
Mas requires OS X 10.10+. As of v2.0, this cookbook requires Chef 12.5+ (or
Chef 12.x and the
compat_resource
cookbook.
A user must be logged into OS X for Mas to operate properly.
Usage
Apps can be installed by using the included custom resources in recipes of your
own, or with the predefined recipe and set of attributes.
Recipes
default
Installs the Mas CLI tool and an attribute-derived set of App Store apps.
Attributes
default
default['mac_app_store']['username'] = nil
default['mac_app_store']['password'] = nil
Set these two attributes with the Apple ID user and password you wish to log
into the App Store as.
default['mac_app_store']['apps'] = {}
Set apps as keys+values under this space, where the key is the full app name
and value is true to install it or false to not. For example:
default['mac_app_store']['apps']['Growl'] = true
Mas can be installed via GitHub download (:direct
, the default) or from
:homebrew
.
default['mac_app_store']['mas']['source'] = nil
If desired, a specific version of Mas can be installed rather than the latest:
default['mac_app_store']['mas']['version'] = nil
By default, Mas will always be run as the current system user. That can be
overridden:
default['mac_app_store']['mas']['system_user'] = nil
In certain circumstances-e.g. Chef running as root-it may be necessary to run
Mas via the reattach-to-user-namespace
utility:
default['mac_app_store']['mas']['use_rtun'] = nil
Resources
mac_app_store_mas
A custom resource to manage installation of the Mas CLI tool for interacting
with the App Store.
Syntax:
mac_app_store_mas 'default' do
source :direct
version: '1.2.3'
username 'example@example.com'
password 'abc123'
system_user 'vagrant'
use_rtun false
action %i(install sign_in)
end
Actions:
Action | Description |
---|---|
:install |
Default; install the Mas CLI |
:upgrade |
Upgrade Mas, if available |
:remove |
Uninstall Mas |
:sign_in |
Use Mas to sign into the App Store |
:sign_out |
Sign out of the App Store |
:upgrade_apps |
Install any upgrades for apps on the system |
Properties:
Property | Default | Description |
---|---|---|
source | :direct |
Install from GitHub (:direct ) or :homebrew
|
version | nil |
The version of Mas to install |
username | nil |
An Apple ID username |
password | nil |
An Apple ID password |
system_user | Etc.getlogin |
The user to execute Mas commands as |
use_rtun | false |
Use RtUN when shelling out to Mas |
action | %i(install sign_in) |
Action(s) to perform |
mac_app_store_app
Used to install a single App Store app via Mas. Requires that an Apple ID be
signed into.
Syntax:
mac_app_store_app 'Some App' do
app_name 'Some App'
system_user 'vagrant'
use_rtun false
action :install
end
Actions:
Action | Description |
---|---|
:install |
Default; installs the given app |
:upgrade |
Upgrade or install the app |
Properties:
Property | Default | Description |
---|---|---|
app_name | resource name | App name if it doesn't match resource name |
system_user | Etc.getlogin |
The user to execute Mas commands as |
use_rtun | false |
Use RtUN when shelling out to Mas |
action | :install |
Action(s) to perform |
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Add tests for the new feature; ensure they pass (
bundle exec rake
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- Watch the pull request and ensure the build passes
License & Authors
- Author: Jonathan Hartman j@p4nt5.com
Copyright 2015-2016, Jonathan Hartman
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Mac App Store Cookbook CHANGELOG
v2.1.0 (2016-06-08)
- Add the option of using reattach-to-user-namespace
v2.0.3 (2016-06-02)
- Shell out as the correct user in helper methods
v2.0.2 (2016-05-31)
- Quote passwords passed to mas CLI in log_in action
v2.0.1 (2016-05-24)
- Add a ChefSpec upgrade app matcher
v2.0.0 (2016-05-23)
- Completely rewrite to use Mas CLI instead of mouse control
- Update to use custom resources (breaking Chef 11 compatibility)
v1.2.0 (2016-03-25)
- Update build-essential dep to v3.x
v1.1.1 (2016-02-24)
- Fix issue with bundled apps not getting accessibility rights
v1.1.0 (2015-08-16)
- Update to Chef 12-style provider mapping (drops compatibility with Chef 11).
- Replace dependency on macosx_accessibility (deprecated) with privacy_services_manager.
v1.0.1 (2015-08-06)
- Replace references to App Store "Purchases" tab (now named "Purchased").
v1.0.0 (2015-05-08)
- Pin to a newer (albeit prerelease) version of the AXElements gem that doesn't error out under Yosemite.
- Drop the
mac_app_store_trusted_app
resource--it doesn't belong here. Use the new osx_accessibility cookbook instead. - Refactor everything out of the compile stage--end the arms race.
- Configure the App Store to open (and quit) on every Chef run--its guard was failing when installing apps inline inside other resources.
v0.1.0 (2015-04-20)
- Initial release!
v0.0.1 (2015-01-04)
- Development started
Foodcritic Metric
2.1.0 passed this metric
2.1.0 passed this metric