MAC安装jenkins

一、安装homebrew
步骤见:https://blog.csdn.net/fuxiu_/article/details/125212919
二、安装jdk8(jenkins依赖)

brew install homebrew/cask-versions/adoptopenjdk8 --cask

三、安装jenkins。PS:Homebrew会将软件包安装到独立目录/usr/local/Cellar,并将其文件软链接至/usr/local

brew install jenkins

四、安装后就可以启动了。
1、启动jenkins:

brew services start jenkins

2、停止jenkins

brew services stop jenkins

3、重启jenkins

brew services restart jenkins

五、获取jenkins密码

sudo cat /Users/${你的计算机名称}/.jenkins/secrets/initialAdminPassword

六、启动jenkins后,浏览器访问localhost:8080 or 127.0.0.1:8080 ,输入密码
七、如果需要局域网访问jenkins,需要修改端口

# 打开配置文件
sudo vim /usr/local/opt/jenkins/homebrew.mxcl.jenkins.plist

修改httpListenAddress为0.0.0.0,修改后需要重启jenkins

"1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
"1.0">

        KeepAlive</key>
        
        Label</key>
        homebrew.mxcl.jenkins</string>
        ProgramArguments</key>
        
                /usr/local/opt/openjdk@11/bin/java</string>
                -Dmail.smtp.starttls.enable=true</string>
                -jar</string>
                /usr/local/opt/jenkins/libexec/jenkins.war</string>
                --httpListenAddress=127.0.0.1</string>
                --httpPort=8080</string>
        </array>
        RunAtLoad</key>
        
        StandardErrorPath</key>
        /usr/local/var/log/jenkins/error.log</string>
        StandardOutPath</key>
"/usr/local/opt/jenkins/homebrew.mxcl.jenkins.plist" 25L, 801B

你可能感兴趣的:(jenkins持续集成,jenkins,macos,运维)