我的Jenkins之路(第一天)Mac环境下安装jenkins

1、安装brew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)

2、安装jenkins

brew install jenkins

# /usr/local/Cellar/jenkins/2.206

kenwu@KenMBP  ~  brew list jenkins
/usr/local/Cellar/jenkins/2.206/bin/jenkins
/usr/local/Cellar/jenkins/2.206/bin/jenkins-cli
/usr/local/Cellar/jenkins/2.206/homebrew.mxcl.jenkins.plist
/usr/local/Cellar/jenkins/2.206/libexec/ (2 files)

3、执行war包

java -jar /usr/local/Cellar/jenkins/2.206/libexec/jenkins.war --httpPort=8080

4、命令启动/停止/重启jenkins

#启动jenkins
brew services start jenkins
#停止jenkins 
brew services stop jenkins
#重启jenkins
brew services restart jenkins

5、修改局域网可以访问

vim homebrew.mxcl.jenkins.plist
<?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</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/libexec/jenkins.war</string>
      <string>--httpListenAddress=0.0.0.0</string>
      <string>--httpPort=8080</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
  </dict>
</plist>

6、 打开jenkins

浏览器输入地址:http://0.0.0.0:8080


评论(0 ) 点赞(3)


暂未登录,请登录之后发表评论。 QQ