
jenkins是一个开源的基于java开发、提供友好 *** 作界面的持续集成(CI)工具,主要用于持续、自动的构建/测试软件项目、监控外部任务的运行。通常与版本管理工具(SCM)、构建工具结合使用;常用的版本控制工具有Maven、Ant、Gradle。
二.jenkins的安装
官网:https://www.jenkins.io/download/
1.下载并安装(依赖jdk8,在安装jenkins之前需要下载jdk8)
(1)配置官方源yum安装(推荐)
[root@jenkins ~]# wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
[root@jenkins ~]# rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
[root@jenkins ~]# yum install -y java jenkins
[root@jenkins ~]# systemctl start jenkins
(2)清华大学源
[root@jenkins ~]# wget https://mirror.tuna.tsinghua.edu.cn/jenkins/redhat-stable/jenkins-2.263.1-1.1.noarch.rpm
[root@jenkins ~]# yum install -y java
[root@jenkins ~]# yum localinstall -y jenkins-2.263.1-1.1.noarch.rpm
[root@jenkins ~]# systemctl start jenkins
mac系统的安装可以直接通过brew进行安装,安装的是最新的jenkins版本
brew cask install homebrew/cask-versions/adoptopenjdk8
brew install jenkins
2.jenkins的启动、重启和停止
#启动jenkins
brew services start jenkins
#停止jenkins
brew services stop jenkins
#重启jenkins
brew services restart jenkins
三.jenkins登录访问
1.获取密码
# 获取密码
cat /Users/${计算机名称}/.jenkins/secrets/initialAdminPassword
2.访问jenkins
localhost:8080
3.修改端口或者局域网访问
默认的地址httpListenAddress是本机地址,如果局域网需要访问的话需要改成0.0.0.0,修改httpPort的值就是修改端口
# 打开配置文件
sudo vim /usr/local/opt/jenkins/homebrew.mxcl.jenkins.plist
#重启jenkins
brew services restart 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">
Label</key>
homebrew.mxcl.jenkins</string>
ProgramArguments</key>
/usr/libexec/java_home</string>
-v</string>
1.8</string>
--exec</string>
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>
</dict>
</plist>
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)