Jenkins is Continuous Integration automation control software that allows developers to automate repetitive parts of the software development process. While Jenkins can be installed on many operating systems, this guide will focus on the macOS install process.
This guide assumes you have a fresh install of the latest macOS along with Xcode, and that you don’t already have a Jenkins master server. In a future guide, we will add Jenkins slave servers to the setup.
Jenkins – an open source automation server which enables developers around the world to reliably build, test, and deploy their software. Jenkins download and deployment The Jenkins project produces two release lines: Stable (LTS) and regular (Weekly). Depending on your organization's needs, one may be preferred over the other. Once you're all set with the basics, enough RAM, enough disc space, and the latest version of Java installed, open a browser to jenkins.io/download. Scroll down the page until you see the Mac OS X. Posted in Admin, Deploy, Mac Tagged with: 10.7, 10.8, autopkg, deployment, jenkins, Mac Os X, Mac Os X Server, management, munki 0 comments on “ Jenkins Setup on Os X server ” 1 Pings/Trackbacks for 'Jenkins Setup on Os X server'.
There are a few ways to install Jenkins on macOS – we’re going to install it using a package manager for macOS called Homebrew. If Homebrew is already installed then skip the next step (check by running “brew -v” in Terminal).
Let’s install Homebrew by opening Terminal and entering the following command (this command is all one line):
The installer will give you a list of things it’s going to do, just press enter and Homebrew will be installed.
Now that you have Homebrew installed, you can type check to see if there are any recommendations for your setup:
For example, you may have an outdated version of Xcode, in which case you may want to upgrade that:
![]()
Before installing Jenkins, we need to install a specific version of Java required by Jenkins – it may ask you for your password to set permissions properly:
Now we can install Jenkins – we’re going to install the LTS (long-term support version, which is typically more stable):
We want the Jenkins web interface to be accessible from anywhere (not just on the local machine), so we’re going to open up the config file:
Find this line:
And change it to:
(to exit out of nano after making the change, hit Ctrl+X, hit Y to save the changes, and hit Enter)
Let’s start Jenkins and set it to run automatically when the system is rebooted:
The rest of the configuration will mostly be done in a browser on the local machine. Open up Safari and visit http://localhost:8080 , where we will see a screen like this:
Grab the red highlighted text and in Terminal use the ‘cat’ command to display the initial password:
Copy that password and paste it into the Unlock Jenkins page. We’re done with Terminal, feel free to close it.
We can now Customize Jenkins and install some plugins. For now we’re going to choose Install suggested plugins.
The installer now downloads and installs the plugins:
Create an admin user and Save and Continue:
Set the URL that users will be using to log in to Jenkins. If users will be connecting to the server remotely, it’s best to set up an A record (like jenkins.yourdomain.com) and set the Jenkins URL to http://jenkins.yourdomain.com:8080. Click Save and Finish:
Setup is complete – click Start using Jenkins.
The rest of the configuration will be done within the Jenkins web interface. You can now create jobs, manage Jenkins and install new plugins, and add new users.
How to Start / Restart Jenkins on macOS
To start Jenkins and make sure it runs after a reboot:
To restart the Jenkins service and make sure it runs after a reboot:
Note: If you didn’t install the LTS version of Jenkins, don’t include the “-lts” portion of the above commands.
Jenkins Os X – 3nd install
this time no jenkins group => using munki
1 Create jenkins Home Dir & log dirs1.1 Create the jenkins folder + the Home folder1.2 Apply ownership1.3 Create log folder1.4 Apply ownership1.5 create symlinks for some command line tools (optional)
Home dir symlink creation
Jenkins has its user dir at /Users/Shared/Jenkins. Some command line tools assumes that home dir is at /Users/jenkins. You have to make symlink:
Note: finally Doing so seems to help to get correct paths.
also note I changed jenkins home jenkins.war to reflect actual path. see 5.1! I did both actions together so not sure wich one or if both did the trick.
Obviously giving the correct path seems logic to me ;)
2 Create jenkins User & Group
3 jenkins install via brew3.1 Important Note ! :Don’t run “manually”
java -jar /usr/local/opt/jenkins/libexec/jenkins.war
as stated by brew after the install.
It has messed things up for me.
I noticed than if I launched it as my current user, it creates a .jenkins folder inside the current user (the one than runs the java jar).
AND it then configure user.home varaible with the user and not jenkins.
I would not try either as logged in as jenkins user.
Tried it too, it made the .jenkins folder inside the jenkins home dir. We don’t want that as we edited plist and .sh scripts with variables. ![]()
Note : I may be wrong as .jenkins seems to be needed anyway. and it’s been recreated in my home dir ?
3.2 Important Note bis :
Concerning the LaunchAgent from brew. Just leave it, and follow on, as other have done work before and we can use that instead as it is more suited.
4 jenkins Setting-Up Defaults
With sudo
Will create the plist preferences file:
/Library/Preferences/org.jenkins-ci
5 jenkins App support script
/Library/Application Support/jenkins/jenkins-runner.sh
5.1 Note :
On Line 15-16 Path /Applications/jenkins/jenkins.war is wrong.
change
to
6 jenkins launchAgent
Copy the file
Apply root ownership and chmod 644
/Library/LaunchAgents/org.jenkins-ci.plist
Finally let’s launch this:
WARNING be sure to be the jenkins user at any time you need to start and stop – no being so made errors on errors after updates or with java launched by me and notjenkins ????
didn’t get why – took me hours to figure out what was braking, notwhat but why. Please note also that I don’t know shit about java at all. Well I know that I worked on the National French Launch of Java back in the days I was working in an agency ;)
Go to http://127.0.0.1:8080
Successlaunchd is okNote : you WANT to make a backup of the full jenkins directory (or not)
I use CarbonCopyCloner: easy GUI, fast cloning.
7 Setup Security once on the homepage
Setting up Security
7.1 step1 Security Realm
Samsung frame manager mac download. Security Realm
Choosed to UNIX user/group db (aka system)
change only this then apply and test if you can login !
If ok, then we can go on and change Authorization
Later on we’ll try to add LDAP support
7.1 step2 Authorization
Authorization
Choosed: Logged-in users can do anything
Ok Success for me I now have the log in menu
8 Configure from within the webapp
from
go there
in GLobal Properties
name: OSX_KEYCHAIN_LOCATION
value: /Volumes/DEPLOY_IMAGES/DEPLOYMENT_STAGE/jenkins/Library/Keychains/login.keychain
Download llvm compiler for mac. name: OSX_KEYCHAIN_PASSWORD
value: jenkins Note:
9 jenkins ssh-keygen
I want jenkins to be able to do commits with git
(not done yet)
so let’s prepare the work
let’s go
check we’re in jenkins home
Note:
I copied my own known_hosts to get things faster.
10 Start and stop jenkins
https://postree982.weebly.com/blog/capture-one-free-download-mac. with launchctl (launchd)
Do it as jenkins user
to stop
or you might want to unload
to start again
(if you unloaded)
or start
from web interface:
Success
jenkins is ok
Note : you WANT to make a backup of the full jenkins directory (or not)
I use CarbonCopyCloner: easy GUI, fast cloning.
11 jenkins Updates
*nix/Mac Auto-Upgrade With Container
If you run Jenkins with java -jar jenkins.war, Jenkins will be able to update itself from the Manage Jenkins page. This is the simplest way to do automatic upgrades.
Finnaly got it to work with a simple
brew update jenkins !
Quick tip:
• we need to stop jenkins with launchctl
• do the switch (or install? or upgrade then switch)
• reboot — no need to reboot when properly configured :)
https://namiso.hatenablog.com/entry/2020/10/15/045548. • start jenkins again
12 reimport olders jobs
I screwed my first and second setups, (and finally it was good on my third attempt, see 3.1)
Tada ! All my jobs are here.
Importing old jobs is successfull.
Kick the buddy download mac. Now let’s see if they are still working as I did not add environment variables for autopkg (will see if needed in a minute)
Had Failures as I said (permissions pb on autopkg and/or munki repo)
from my experience, Autopkg Cache and recipes must be owned by jenkins. if owned by “me” even with munki group it’s a no go.
So I add my user to the munki group. maybe will add some ACLS if needed to get reed of that annoying stuff.
a. /Library/AutoPkgs -> jenkins:munki
Permissions ok (jenkins:munki), so not that.
b. munkirepo -> myaccount:munki
Check the munki repo premissions (I deleted jenkins user lots of time and changed UID sometimes too)
Failure again with jenkins User
c. autopkg from jenkinsuser
Failure from within jenkins user, success from current user (me). Xvid codec firefox mac download. Seems to be Autopkg config problems .
Assuming you are in jenkins homedir
move to Autopkg in ~homedir.
OR you could just configure from jenkins user (RTFM)
now run the “jenkins command” manually in the terminal.
Mac Os X Download Dmg
No errors, all is fine now.
note the result just indicate ther is no new updates
See this post for autopkg command syntax
http://oemden.com/?p=203
Next, I’ll have to get git working with gitlab.
Some usefull links
That helped me out in my quest
Product and graphic designer turned to be a Mac SysAdmin.
Mac Os X Download
Posted in Admin, Deploy, Mac Tagged with: 10.7, 10.8, autopkg, deployment, jenkins, Mac Os X, Mac Os X Server, management, munki
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2020
Categories |