Installing Jenkins on Mac

 

Download

 

Download the jenkins installer from the below link.

https://jenkins.io/download/

Click on the Mac OS X to download.

image

 

image

 

The Jenkins installer for mac is downloaded.

image

 

Installation

For Jenkins, Java needs to be installed on the system, since Jenkins is written in Java. So check if Java  is installed on the system by running the below command.

java –version

It should return java version information similar to below.

image

 

If java information is not returned, then java is not installed on the system, so install Java first before continuing to the next step.

 

Double click on the downloaded Jenkins installer to launch the installer.

 

Click on ‘Continue’ to start the installation process.

image

 

Click on ‘Continue’ to accept the license and continue to installation.

 

image

 

Click on ‘Agree’ to agree to license terms and continue installation.

 

image

 

The installer asks information regarding which users of the system do you want Jenkins to be installed for. You can leave the default provided and click on ‘Continue’.

image

 

You can change the jenkins installation location by clicking on ‘Change Install Location’, or you can leave the default installation location and click on ‘Install’ to start installing Jenkins.

 

image

 

Enter your mac user name and password to click on ‘Install Software’ to start Jenkins installation.

 

image

 

The installation will take some time to complete.

 

image

 

Click on ‘Close’ once the installation is complete.

 

image

 

Click on ‘Move to Trash’ if you want to delete the Jenkins installer downloaded and used for installation. If you don’t want to delete it, click on ‘Keep’.

 

image

 

The jenkins is installed at the below location.

 

Users/Shared/Jenkins

 

The jenkins installation folder should look similar to below.

 

image

 

Configuration

 

Once the jenkins installation is complete, it opens the below page on the web browser. You need to enter to temp admin password provided by Jenkins to start configuring the jenkins and creating the users on jenkins.

 

The location of the temp password file is provided in the same page below. It is supposed to be at ‘/Users/Shared/Jenkins/Home/secrets/initialAdminPassword’.

 

image

 

Navigate to that location, to open the password file. But as you can see in the below screen shot, there are no files in the secrets folder.

 

image

 

Actually the files are there, but we cant see them. You need to change permissions to view the files in the secrets folder. Follow the below steps to change the permissions.

 

Right click on the secrets folder and select ‘Get Info’ option.

 

image

 

Enter the mac system user name and password to open the information regarding the secrets folder.

image

 

The information regarding the secrets folder is displayed.

 

image

 

Click on the lock symbol at the bottom right side corner of the secrets info view.

 

Enter the mac system user name and password to continue to modify the secrets folder permissions.

 

image

 

The list of the available users and groups on the mac are displayed.

 

image

 

select the user name you used to log into mac and click on ‘Select’ button.

image

 

The user you selected is added to the ‘Sharing & Permissions’ section of the secrets info screen and it indicates that the user you selected has ready only permissions now. Now click on settings button in middle at the bottom of the secrets info view and select ‘Apply to enclosed items’ to save the modifications.

 

image

 

Click on ‘OK’ to save the modifications.

image

 

Now the files inside the secrets folder are displayed and you can see the initialAdminPassword file also inside the secrets folder. Open the initialAdminPassword file and copy the password inside it.

 

image

 

Paste the initial password into ‘Unlock Jenkins’ screen and click on ‘Continue’.

image

 

The jenkins installation is not able to connect to the plugin repository, but they can always be added/removed at any time, so click on ‘Skip Plugin Installations’ to continue configuring Jenkins.

 

image

 

You can create your first admin user for Jenkins.

 

image

 

Provide user name, name and password and click on ‘Save and Continue’ to create a admin user.

 

image

 

The jenkins url can be modified, if needed. This can be changed later if needed, so leave it as it is, and click on ‘Save and Finish’.

image

 

The jenkins installation and configuration is complete and ready for use. Click on ‘Start using Jenkins’.

image

 

The home view of the user you created is displayed.

 

image

 

 

Restart

 

To stop the jenkins service, run the below command in the terminal.

sudo launchctl unload /Library/LaunchDaemons/org.jenkins.ci.plist

To start the jenkins service, run the below command in the terminal.

sudo launchctl load /Library/LaunchDaemons/org.jenkins.ci.plist

 

You may need to enter the mac password to stop/start the jenkins after running the above stop/start commands.

 

image

 

Uninstall

 

Jenkins can be uninstalled running the below command in the terminal.

 

sudo /Library/Application\ Support/Jenkins/Uninstall.command

 

image

 

Conclusion

 

In this post, we have how to install, Configure, Restart and Uninstall Jenkins on Mac OS X. Once the Jenkins installation is complete, the projects creating builds, pipelines etc is same on all the environments, which we discuss in later posts.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s