Install Jenkins on macOS

Automate all the things (Part 1)

As a DevOps Engineer you’re constantly trying to automate almost everything you do to make you life easier. What better way to automate things then using Jenkins. This post is a first part of a series on how to use Jenkins to automate almost everything to manage macOS machines.

Why macOS?

“Why macOS when you can use a [Docker](https://hub.docker.com//jenkins/) image?”_ you might ask, but there is a method to my madness here and I hope you read the whole series. I will highlight some very cool things about Jenkins and macOS.

Download & Install

To download the latest stable version of Jenkins for macOS click here and run the package to install it to your Mac. The installer sets up Jenkins as a launch daemon, listening on port 8080. The launch daemon picks up the command line options from a standard preferences file, /Library/Preferences/org.jenkins-ci.plist. If the file does not exist, built-in defaults are used. Once Jenkins is done being installed restart your computer and then open a browser to navigate to http://localhost:8080.

NOTE: If you would like to configure it outside of the defaults please check here.

Configure Security

Immediately after installation, Jenkins will allow anyone to run anything as user Anonymous, which is bad. We will need to configure security for the newly installed Jenkins installation. Navigate to Manage Jenkins > Configure Global Security where you should something like this picture below:

Picture 1

Before you do anything, create a user that has full administrative rights and everything checked in the matrix security on Jenkins. After the user is created, you should select Jenkins’ own user database and now once you save everything you should get a login screen. If you would want to setup a different login method please check out this.
> NOTE: You can also use other methods to log into Jenkins with Plugins, like GitHub.

Play around

Let’s stop there in order to let you play around with Jenkins once it’s setup on your Mac. Check out this video on YouTube to create your first build job. In Part 2 of this series we will setup a build job that uses AutoPkg to download installable packages for macOS.