首先說明不建議使用官網 dmg 形式的安裝包,搭建環境什么的強烈建議使用命令行。
1. 安裝 brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2. 升級 java
brew cask install java
3. 安裝 jenkins
brew install jenkins
4. 執行
java -jar /usr/local/Cellar/jenkins/2.49/libexec/jenkins.war --httpPort=8080
這里需要注意了2.49這里是當時你安裝的jenkins的版本
Snip20170828_3.png
查看jenkins版本
jenkins -v
Snip20170828_4.png
5.鏈接 launchd 配置文件
ln -sfv /usr/local/opt/jenkins/*.plist ~/Library/LaunchAgents
如果要其他機器也可以訪問,把ip地址改為廣播地址:<string>--httpListenAddress=0.0.0.0</string>
6. 修改完成,執行命令行:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
執行5、6命令的時候如果出現找不到,解決辦法如下截圖
Snip20170828_5.png
7.命令行啟動Jenkins
jenkins
8.打開瀏覽器,輸入 localhost:8080 就可看到Jenkins的web界面
9.Jenkins的一些操作
http://localhost:8080/exit //退出Jenkins
http://localhost:8080/restart //重啟
http://localhost:8080/reload //重新加載