MacOS部署

建议使用命令行安装,使用安装包会有很多权限问题。

homebrew

brew install jenkins  # 安装
brew services start jenkins  # 启动
brew uninstall jenkins  # 卸载

直接下载

https://jenkins.io/download/

Download Jenkins.
Open up a terminal in the download directory.
Run java -jar jenkins.war --httpPort=8080.
Browse to <http://localhost:8080>.
Follow the instructions to complete the installation.

docker部署

启动容器,因为容器中有用maven,所以使用-v来进行指定容器

docker run --name devops-jenkins --user=root -p 8080:8080 -p 50000:50000 
-v /opt/data/jenkins_home:/var/jenkins_home 
-v /opt/maven/xx:/opt/maven/xx
-d jenkins/jenkins:lts
docker run --name devops-jenkins --user=root -p 8080:8080 -p 50000:50000 \\
-v /root/docker/jenkins/jenkins_home:/var/jenkins_home \\
-v /usr/share/maven:/usr/share/maven \\
-d jenkins/jenkins:lts

设置权限

chown -R 1000:1000 /opt/data/jenkins_home/

安装maven git

sudo yum install maven
sudo yum install git