Jenkins Mac本地环境搭建

一、安装

进入 Jenkins官网,选择下载war,或者mac可以使用命令 brew install jenkins
任一选择一个版本

在这里插入图片描述

二、启动Jenkins服务

默认8080端口很大概率被占用,所以我直接配置了端口
// war包启动方式
java -jar jenkins.war —-httpPort=1100

// homebrew启动方式
brew services start jenkins —-httpPort=1100
若出现以下日志,是端口被占用的情况:
hudson.WebAppMain#contextDestroyed: Shutting down a Jenkins instance that was still starting up
Caused by: java.net.BindException: Address already in use
Caused: java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:8080
Caused: java.io.IOException: Failed to start Jetty
若出现以下日志,则启动成功:
xxx@MacBook-Pro desktop % java -jar jenkins.war --httpPort=1100
Running from: /Users/xxx/Desktop/jenkins.war
webroot: $user.home/.jenkins
2022-07-12 03:10:14.617+0000 [id=1]	INFO	org.eclipse.jetty.util.log.Log#initialized: Logging initialized @1091ms to org.eclipse.jetty.util.log.JavaUtilLog
2022-07-12 03:10:14.738+0000 [id=1]	INFO	winstone.Logger#logInternal: Beginning extraction from war file
2022-07-12 03:10:14.778+0000 [id=1]	WARNING	o.e.j.s.handler.ContextHandler#setContextPath: Empty contextPath
2022-07-12 03:10:14.876+0000 [id=1]	INFO	org.eclipse.jetty.server.Server#doStart: jetty-9.4.45.v20220203; built: 2022-02-03T09:14:34.105Z; git: 4a0c91c0be53805e3fcffdcdcc9587d5301863db; jvm 11.0.11+9-LTS
2022-07-12 03:10:15.367+0000 [id=1]	INFO	o.e.j.w.StandardDescriptorProcessor#visitServlet: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
…
hudson.WebAppMain#contextInitialized: Jenkins home directory: /Users/xxx/.jenkins found at: $user.home/.jenkins
Warning: the fonts "Times" and "Times" are not available for the Java logical font "Serif", which may have unexpected appearance or behavior. Re-enable the "Times" font to remove this warning.
2022-07-12 03:10:16.975+0000 [id=1]	INFO	o.e.j.s.handler.ContextHandler#doStart: Started w.@4c432866{Jenkins v2.346.1,/,file:///Users/xxx/.jenkins/war/,AVAILABLE}{/Users/xxx/.jenkins/war}
2022-07-12 03:10:17.031+0000 [id=1]	INFO	o.e.j.server.AbstractConnector#doStart: Started
 …
jenkins.InitReactorRunner$1#onAttained: Loaded all jobs
2022-07-12 03:10:19.054+0000 [id=35]	INFO	jenkins.InitReactorRunner$1#onAttained: Configuration for all jobs updated
2022-07-12 03:10:19.072+0000 [id=59]	INFO	hudson.model.AsyncPeriodicWork#lambda$doRun$1: Started Download metadata
2022-07-12 03:10:19.083+0000 [id=59]	INFO	hudson.util.Retrier#start: Attempt #1 to do the action check updates server
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/Users/xxx/.jenkins/war/WEB-INF/lib/groovy-all-2.4.21.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2022-07-12 03:10:19.550+0000 [id=41]	INFO	jenkins.install.SetupWizard#init: 

*************************************************************
*************************************************************
*************************************************************

Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:

// 初始密码
8a484e0fa02446ac89dfe1b75b3cd0e1

This may also be found at: /Users/xxx/.jenkins/secrets/initialAdminPassword

*************************************************************
*************************************************************
*************************************************************

三、配置Jenkins

进入配置页

启动完成后进入浏览器地址 http://localhost:1100/,密码在上面的启动成功后的日志中就有,复制填入,点击 继续
在这里插入图片描述

选择插件配置方式

我选择了推荐插件,也可以自定义选择插件
![在这里插入图片描述](https://img-blog.csdnimg.cn/d20c86af094d45889322bc73d2138b06.png

依赖自动配置中…

这个过程是自动的,需要几分钟时间
在这里插入图片描述

配置管理员账户

此步骤可以顺便修改初始密码
在这里插入图片描述

配置访问地址在这里插入图片描述


四、完成配置

点击保存并完成就配置好了

在这里插入图片描述

![在这里插入图片描述](https://img-blog.csdnimg.cn/2c6c94ce7f334c038776ea6870812f34.png

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

柯基爱蹦跶

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值