kenhuang.osx_ci
Ansible Role: OSX-CI
This Ansible role installs and sets up the software tools needed to build and deploy macOS/iOS applications. The Mac machine set up with this role can also act as a Jenkins agent.
The role creates a user called ci user
to run builds on the Mac. This user is configured to allow remote login via SSH.
It installs the following tools:
- Homebrew
- Node.js 10 LTS
- Java 8 - Required for Jenkins. This makes the macOS machine ready to be a Jenkins agent.
- fastlane
- CocoaPods
Requirements
This role requires that Xcode Command Line Tools are installed on the target machine. You can find available versions on the Apple Downloads Page. You can also install Xcode Command Line Tools via the terminal using:
xcode-select --install
Please note that this command requires user input, so you can't run it remotely (via SSH).
Since the role needs an authorized SSH key for the ci user
to allow remote login, you should generate the public SSH key in advance and provide it to the role. This public key must be on the machine running the role.
Role Variables
Here are the role variables and their default values. You can find all default variables in defaults/main.yml
.
ci_user: ci_user
ci_user_uid: 5013
ci_user_group: ci_user
The name, UID, and group for the ci user
.
ci_user_public_key_location:
The path to the SSH public key that will be added to the authorized keys for the ci user
. This will allow remote login using SSH.
ci_user_default_keychain: login.keychain
ci_user_default_keychain_password:
The name and password of the default keychain created for the ci user
.
cask_packages: ['java8']
The brew cask packages to install.
ruby_gems: ['fastlane']
The ruby gems to install globally.
homebrew_packages:
A list of additional brew
packages to install.
Dependencies
There are no dependencies.
Example Playbook
- hosts: localhost
vars:
homebrew_packages: ['git']
ci_user_public_key_location: '/path/to/public_key'
ci_user_default_keychain_password: 'keychain_pass'
roles:
- osx-ci
License
Author Information
This role was created in 2019 by MacStadium, Inc.