jenkins 工具使用

使用方式

  • 替代手动,自动化拉取、集成、构建、测试;
  • 是CI/CD持续集成、持续部署主流开发模式中重要的环节;
  • 必须组件
    • jenkins-gitlab,代码公共仓库服务器(至少6G内存);
    • jenkins-server,需要安装 jdk/maven;
    • test-server, 测试服务器;
  • 必备知识
    • shell脚本编写
    • java开发技能
    • ssh 使用

gitLab

  • 安全一体化DevOps平台;
  • 网址
  • 安装指导
  • 企业内部使用的代码托管平台,类似的有github,gitee等开源的代码托管平台;
  • 以CentOS 7为例子(仅支持CentOS 的7版本)

ssh下安装gitlab

  1. 安装依赖项
bash 复制代码
# 安装 curl 网络工具
sudo yum install -y curl
# policycoreutils-python
sudo yum install -y policycoreutils-python 
# 安装 openssh-server
sudo yum install -y openssh-server
# 安装perl
sudo yum install -y perl

# 开机启动 sshd 服务
sudo systemctl enable sshd
sudo systemctl start sshd # 启动ssh服务

# 防火墙中打开http、https访问
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
# 重新加载防火墙配置
sudo systemctl reload firewalld

# postfix服务发送邮件
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix

其他配置
其他SMTP配置

  1. 安装gitlab
bash 复制代码
# 方式1 配置gitlab的软件源(一般用户可能没有权限)
curl -L get.gitlab.cn | bash
# 方式2 配置gitlab的软件源 (一般用户可能没有权限)
curl -fsSL https://packages.gitlab.cn/repository/raw/scripts/setup.sh | /bin/bash

# 安装gitlab
sudo EXTERNAL_URL="http://gitlab.example.com" yum install -y gitlab-jh
# EXTERNAL_URL 映射本地ip 的域名,后续通过web访问gitlab服务
# vim /etc/hosts
# 192.168.211.135  gitlab.example.com

安装过程较慢,耐心等待,安装成功如下:

  1. 启动gitlab
    安装成功即已启动
bash 复制代码
# 管理 gitlab服务   占用80端口,防止与nginx冲突
gitlab-ctl start/stop/restart/status/reconfigure
# 配置
vim /etc/gitlab/gitlab.rb
  1. web界面访问,打开浏览器,输入本地ip(如http://192.168.211.135
    账户:root
    密码:在/etc/gitlab/xxx_password
    登录后修改密码;


docker下安装gitlab

相关推荐
一勺菠萝丶19 小时前
Jenkins 构建 Node 项目报错解析与解决——pnpm lockfile 问题实战
elasticsearch·servlet·jenkins
xixingzhe21 天前
jenkins脚本触发部署
运维·jenkins
躲在云朵里`1 天前
ElasticSearch复习指南:从零搭建一个商品搜索案例
运维·jenkins
xiaok2 天前
分支管理提交代码
git·gitlab·github
Cloud Traveler3 天前
第3天-Jenkins详解-3
运维·分布式·jenkins
u0104058363 天前
电商导购平台的搜索引擎优化:基于Elasticsearch的商品精准推荐系统
elasticsearch·搜索引擎·jenkins
*老工具人了*3 天前
Terraform整合到GitLab+Jenkins工具链
gitlab·jenkins·terraform
码畜也有梦想3 天前
Maven中optional的作用
java·jenkins·maven
走上未曾设想的道路4 天前
中标麒麟7.4为gitlab添加Registry
gitlab