文章目录
- 关于 Jenkins
- macOS 上安装 Jenkins
- 方式一:brew
- 方式二:tomcat + Jenkins war
关于 Jenkins
官网上下载Jenkins并将其安装到持续集成服务器
https://jenkins.io/download/
macOS 上安装 Jenkins
现在本 macOS 上测试
https://www.jenkins.io/download/lts/macos/
方式一:brew
# Install the latest LTS version:
brew install jenkins-lts
# Install a specific LTS version:
brew install jenkins-lts@YOUR_VERSION
# Start the Jenkins service:
brew services start jenkins-lts
# Restart the Jenkins service:
brew services restart jenkins-lts
# Update the Jenkins version:
brew upgrade jenkins-lts
方式二:tomcat + Jenkins war
1、下载 tomcat
https://tomcat.apache.org
这里我下载 Tomcat10, binary distributions 中的 Core zip
2、启动 tomcat
将压缩文件解压到:/Users/shushu/software/apache-tomcat-10.0.18
$ cd /Users/shushu/software/apache-tomcat-10.0.18
$ sudo sh startup.sh
Using CATALINA_BASE: /Users/shushu/software/apache-tomcat-10.0.18
Using CATALINA_HOME: /Users/shushu/software/apache-tomcat-10.0.18
Using CATALINA_TMPDIR: /Users/shushu/software/apache-tomcat-10.0.18/temp
Using JRE_HOME: /Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home
Using CLASSPATH: /Users/shushu/software/apache-tomcat-10.0.18/bin/bootstrap.jar:/Users/shushu/software/apache-tomcat-10.0.18/bin/tomcat-juli.jar
Using CATALINA_OPTS:
Tomcat started.
浏览器中输入 http://localhost:8080 ,如下代表启动成功
关闭tomcat服务命令
$ sh shutdown.sh
如果报一下错误
Cannot find ./catalina.sh
The file is absent or does not have execute permission
This file is needed to run this program
原因是权限不够,对这个文件夹的sh文件 赋予权限即可。
$ chmod 777 *.sh
3、下载 Jenkins war 包
https://www.jenkins.io/download/