Gitlab和Jenkins集成 实现CI (一)

版本声明

部署时通过docker拉取的最新版本

gitlab: 16.8

jenkins: 2.426.3

安装环境

可参考这篇文章

停止防火墙

由于在内网,这里防火墙彻底关掉,如果再外网或者云上的悠着点

shell 复制代码
systemctl stop firewalled
systemctl disable firewalled

systemctl stop iptables
systemctl disable iptables

配置gitlab

登录gitlab
获取初始密码或者重置root用户密码,可参考这篇博文

设置本地化

Admin Area settings Preferences Localization Default first day of the week 选择Monday Default language 选择简体中文

设置用户邮箱&设置密码

邮箱用于系统发送主要信息给管理员
用户头像 Edit profile Time zone 选择UTF+8 beijing Main settings Email 填写管理员邮箱 需管理员点收到的链接确认 选择同级的Password 修改密码

设置注册安全

Admin Area settings Genera Sign-up restrictions Sign-up enabled 取消勾选

新增群组&创建项目

Homepage Groups New Group Create Group 填写组名

Visibility level:

  • Private 群组内可访问
  • Internal 登录gitlab的用户可访问
  • Public 所有人员可以访问

创建完成群组之后,直接创建项目(项目依赖于组)
New Project Create blank project 填写项目名称

项目创建完成后,增加一个文件,内容随便填点,方便后续使用

配置Jenkins

这里默认你已经安装好jenkins

获取初始密码

shell 复制代码
#jenkins可以改成你自己的容器名称
docker container logs jenkins
#复制日志里面的密码,登录jenkins

修改密码

用户头像 Configure Password 填写新的密码

安装插件

注意:插件卸载,下次重新启动时才会执行卸载
Dashboard Manage Jenkins Plugins 安装以下插件

  • Build Timeout
  • Email Extension Plugin
  • GitLab Authentication plugin
  • GitLab Branch Source Plugin
  • GitLab Plugin
  • Matrix Authorization Strategy Plugin
  • OkHttp Plugin
  • PAM Authentication plugin
  • Pipeline
  • Pipeline: Stage View Plugin
  • SSH Build Agents plugin
  • Timestamper
  • Workspace Cleanup Plugin
  • Localization: Chinese (Simplified)

基础配置

Dashboard Manage Jenkins System Jenkins Location System Admin e-mail address 填写用户邮箱 GitLab 勾掉 Enable authentication for '/project' end-point GitLab GitLab connections Connection name 填写 jenkins GitLab host URL 填写gitlab的裸url Credentials 配置gitlab api token一章介绍

都看到这里了,点个赞再走吧!^ _ ^ 继续看 Gitlab和Jenkins集成 实现CI (二)

相关推荐
JavaDog程序狗12 小时前
【指南】uni-app微信小程序多环境CI-CD完全指南
ci/cd·uni-app·jenkins
Patrick_Wilson1 天前
sccache 用在 Rust 上为什么常「不省编译」:原理、限制与 Windows 接入
ci/cd·rust·编译器
北风toto2 天前
研发效能与后端核心技术全景指南:从CI/CD到共性组件实战
java·开发语言·ci/cd
heimeiyingwang2 天前
【GitOps·入门篇】工具生态:ArgoCD、Flux、Jenkins X 对比选型
jenkins·flux·argocd·gitops
Jeanyia2 天前
GitLab 配套 Git 常用命令
git·gitlab
顿哥GPT3 天前
ChatGPT Plus/Pro 解锁 Codex 后这样玩:云端任务、本地 CLI 与 CI/CD 的进阶实战手册
ci/cd·chatgpt
游戏开发爱好者83 天前
App Store 上传 IPA 自动化,.p8 密钥认证与 CI/CD 接入实战
android·运维·ci/cd·小程序·uni-app·自动化·iphone
极小狐3 天前
极狐GitLab 补丁版本:19.2.1、19.1.3、19.0.5
网络·安全·gitlab·极狐gitlab·安全更新·补丁版本
骇客野人3 天前
基于Nginx+Eureka+Apollo+Jenkins+SpringBoot Web系统分布式部署方案
nginx·eureka·jenkins
rustfs4 天前
GitLab 如何与 RustFS 集成?
分布式·rust·gitlab