Jenkins 部署 之 Mac 一

Jenkins 部署 之 Mac 一

一.Jenkins 部署依赖 JDK 环境

查看 Mac JDK 环境,如果没有安装,先安装

打开终端输入命令:java -version

Mac安装配置 JDK

二. 检查 HomeBrew 安装

检查 HomeBrew 是否安装,终端输入命令:brew -v

Mac安装HomeBrew

三. 通过 HomeBrew 安装 Jenkins

打开终端输入命令:brew install jenkins

安装如下

bash 复制代码
userName@userNames-Mac-mini ~ % brew install jenkins
==> Downloading https://formulae.brew.sh/api/formula.jws.json
==> Downloading https://formulae.brew.sh/api/cask.jws.json
==> Downloading https://ghcr.io/v2/homebrew/core/jenkins/manifests/2.497
######################################################################### 100.0%
==> Fetching dependencies for jenkins: libpng, freetype, giflib, fontconfig, pcre2, python-packaging, mpdecimal, ca-certificates, openssl@3, readline, sqlite, xz, expat, python@3.13, libunistring, gettext, glib, xorgproto, libxau, libxdmcp, libxcb, libx11, libxext, libxrender, lzo, pixman, cairo, graphite2, icu4c@76, harfbuzz, jpeg-turbo, lz4, zstd, libtiff, little-cms2 and openjdk@21
==> Downloading https://ghcr.io/v2/homebrew/core/libpng/manifests/1.6.46
######################################################################### 100.0%
==> Fetching libpng
==> Downloading https://ghcr.io/v2/homebrew/core/libpng/blobs/sha256:34fde4703af
######################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/freetype/manifests/2.13.3
######################################################################### 100.0%
==> Fetching freetype
==> Downloading https://ghcr.io/v2/homebrew/core/freetype/blobs/sha256:e79e0ffb3
######################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/giflib/manifests/5.2.2
######################################################################### 100.0%

上面只是一部分,会有许多下载和安装,等待一会,安装成功,最后会输出如下

bash 复制代码
==> Installing jenkins
==> Pouring jenkins--2.497.all.bottle.tar.gz
==> Caveats
Note: When using launchctl the port will be 8080.

To start jenkins now and restart at login:
  brew services start jenkins
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/jenkins/bin/jenkins --httpListenAddress\=127.0.0.1 --httpPort\=8080
==> Summary
  /usr/local/Cellar/jenkins/2.497: 9 files, 93.9MB
==> Running `brew cleanup jenkins`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Caveats
==> jenkins
Note: When using launchctl the port will be 8080.

To start jenkins now and restart at login:
  brew services start jenkins
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/jenkins/bin/jenkins --httpListenAddress\=127.0.0.1 --httpPort\=8080
userName@userNames-Mac-mini ~ % 

Jenkins 启动命令:

bash 复制代码
brew services start jenkins

Jenkins 重启命令:

bash 复制代码
brew services restart jenkins

Jenkins 停止命令:

bash 复制代码
brew services stop jenkins

终端执行Jenkins启动命令

bash 复制代码
userName@userNames-Mac-mini ~ % brew services start jenkins
==> Tapping homebrew/services
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services'...
remote: Enumerating objects: 4040, done.
remote: Counting objects: 100% (473/473), done.
remote: Compressing objects: 100% (144/144), done.
remote: Total 4040 (delta 388), reused 329 (delta 329), pack-reused 3567 (from 2)
Receiving objects: 100% (4040/4040), 1.21 MiB | 4.29 MiB/s, done.
Resolving deltas: 100% (1962/1962), done.
Tapped 2 commands (53 files, 1.4MB).
==> Successfully started `jenkins` (label: homebrew.mxcl.jenkins)

出现 Successfully started jenkins (label: homebrew.mxcl.jenkins) 代表启动成功了

四、浏览器打开和配置 Jenkins

(1) 打开浏览器输入网址:http://localhost:8080

(2) 解锁需要输入管理员密码,复制界面上的路径 /Users/liqiang/.jenkins/secrets/initialAdminPassword

方式一:打开终端输入命令:open /Users/liqiang/.jenkins/secrets/initialAdminPassword 打开文件,复制密码

方式二:通过路径 /Users/liqiang/.jenkins/secrets/initialAdminPassword 找到文件 initialAdminPassword 用文本打开,复制密码

复制密码到界面,点击 Continue 继续

(3) 配置安装Jenkins插件

对于新手选择 左侧 安装推荐的插件 : Install suggested plugins

点击安装,如下

安装失败后,点击 重试

(4) 安装完成后,弹出创建管理员界面

填好信息后点击 Save and Continue

点击 Save and Finish

(5) 开始 jenkins

相关推荐
oMcLin2 天前
如何在Rocky Linux 8.5上部署并优化Jenkins流水线,支持跨平台CI/CD自动化与容器化构建?
linux·ci/cd·jenkins
无心水2 天前
【分布式利器:腾讯TSF】7、TSF高级部署策略全解析:蓝绿/灰度发布落地+Jenkins CI/CD集成(Java微服务实战)
java·人工智能·分布式·ci/cd·微服务·jenkins·腾讯tsf
记得开心一点嘛3 天前
Elasticsearch
运维·jenkins
oMcLin3 天前
如何在 Ubuntu 22.04 上部署并优化 Jenkins 2.x 流水线,提升持续集成与自动化测试的效率?
ubuntu·ci/cd·jenkins
世界尽头与你3 天前
CVE-2024-43044_ Jenkins agent connections 文件读取漏洞
安全·网络安全·渗透测试·jenkins
tianyuanwo3 天前
TERM变量迷思:从Jenkins节点连接差异看终端仿真与构建系统的微妙关系
运维·ssh·jenkins·java web·term
一勺菠萝丶3 天前
Jenkins 打包显示 SUCCESS 但产物不全?日志出现 Killed 的排查与解决(小白版)
运维·jenkins
Anakki3 天前
企业级 Elastic Stack 集成架构:Spring Boot 3.x 与 Elasticsearch 8.x 深度实践指南
运维·jenkins·springboot·elastic search
一只往上爬的蜗牛3 天前
【Jenkins】Jenkins 中如何在 Build Artifacts 显示自动化测试生成的文件
运维·jenkins
2501_906150563 天前
开源问卷平台DWSurvey开发配置记录
运维·开源·jenkins