Jenkins on mac

Local Jenkins libraries

  • git
  • skaffold
  • docker
  • argo-cd cli
  • jq

Basic Plug-In

  • Git Parameter Plug-In
  • Amazon ECR plugin
  • Docker Pipeline
  • Docker API
  • Docker
brew install jenkins-lts

change the default port

Before modify the Jenkins port on macOS,you must pay attention to the way of installation of Jenkins.

Here I recommend you install Jenkins by ‘Homebrew’ if you want to deal with iOS project building,because you may meet some errors that the way of using .pkg to install,it’s really hard to solve the problems.

I have installed Jenkins LTS by brew command:

brew install jenkins-lts
brew services start jenkins-lts
jenkins-lts

So my Jenkins plist file is here:

/usr/local/Cellar/jenkins-lts/2.263.4/homebrew.mxcl.jenkins-lts.plist

You can modify the httpPort value from default 8080 to the other value,and then save the file.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>homebrew.mxcl.jenkins-lts</string>
    <key>ProgramArguments</key>
    <array>
      <string>/usr/libexec/java_home</string>
      <string>-v</string>
      <string>1.8</string>
      <string>--exec</string>
      <string>java</string>
      <string>-Dmail.smtp.starttls.enable=true</string>
      <string>-jar</string>
      <string>/usr/local/opt/jenkins-lts/libexec/jenkins.war</string>
      <string>--httpListenAddress=127.0.0.1</string>
      <string>--httpPort=8100</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
  </dict>
</plist>

sudo launchctl unload command will not work for you.You must try these commands to restart your Jenkins and make the port modification works.

brew services stop jenkins-lts
brew services start jenkins-lts

Add some PATH

    <key>EnvironmentVariables</key>
    <dict>
      <key>PATH</key>
      <string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
    </dict>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>homebrew.mxcl.jenkins-lts</string>
    <key>ProgramArguments</key>
    <array>
      <string>/usr/libexec/java_home</string>
      <string>-v</string>
      <string>1.8</string>
      <string>--exec</string>
      <string>java</string>
      <string>-Dmail.smtp.starttls.enable=true</string>
      <string>-jar</string>
      <string>/usr/local/opt/jenkins-lts/libexec/jenkins.war</string>
      <string>--httpListenAddress=127.0.0.1</string>
      <string>--httpPort=8100</string>
    </array>
    <key>EnvironmentVariables</key>
    <dict>
      <key>PATH</key>
      <string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
    </dict>
    <key>RunAtLoad</key>
    <true/>
  </dict>
</plist>

Leave a Reply

Your email address will not be published.

ANOTE.DEV