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

相关推荐
佐杰4 小时前
Jenkins是什么
运维·jenkins
爱宇阳4 小时前
Vue3 项目 GitLab CI/CD 自动构建并推送到 Harbor 教程
ci/cd·gitlab
一周困⁸天.12 小时前
Elasticsearch+Logstash+Filebeat+Kibana部署【7.1.1版本】
大数据·elk·elasticsearch·jenkins
xiaobangsky15 小时前
Elasticsearch安装使用
elasticsearch·jenkins
西部森林牧歌18 小时前
Arbess零基础学习 - 使用Arbess+GitLab实现Node.js项目自动化构建/主机部署
ci/cd·node.js·gitlab·arbess·tiklab devops
i_am_a_div_日积月累_2 天前
jenkins打包报错
运维·rust·jenkins·jenkins打包报错
一个处女座的暖男程序猿2 天前
2G2核服务器安装ES
服务器·elasticsearch·jenkins
极小狐2 天前
极狐GitLab 18.5 正式发布,更新 Maven 虚拟仓库 UI(Beta)、全新个人主页、实例级合规与安全策略管理 以及 DAST 认证脚本 等
java·gitlab·maven
一个处女座的暖男程序猿2 天前
2G2核服务器安装ES 7X版本
服务器·elasticsearch·jenkins
GeminiJM2 天前
优化Elasticsearch批量写入性能:从单分片瓶颈到多索引架构
elasticsearch·架构·jenkins