当前位置: 首页 > news >正文

OpenEuler部署gitlab(小白的“升级打怪”成长之路)

目录

一、安装gitlab

1、安装gitlab

2、修改配置文件

二、创建项目

1、安装git

2、克隆项目

三、配置GitLab Runner

1、安装GitLab Runner

2、安装docker

3、测试 Runner


一、安装gitlab

1、安装gitlab

yum localinstall -y gitlab-jh-17.7.0-jh.0.el8.x86_64.rpm

2、修改配置文件

cd /etc/gitlab/
​
vim gitlab.rb 
#修改配置

##初始化
gitlab-ctl reconfigure
​
##查看密码
cat initial_root_password 
​
netstat -anptu | grep 80
​
##启动服务
gitlab-ctl start

网站访问:192.168.58.184

更改语言环境

二、创建项目

1、安装git

 yum install -y git

2、克隆项目

使用http克隆项目

git clone http://192.168.58.184:root/testproject.git
root
cyw+REBUuyStAXnL9BDkMrZ3LjZLjVa/L9FteYxp6EI=

使用SSH克隆项目

passwd git 
123
ssh-keygen
cd .ssh/
​
[root@workspace .ssh]# ls
id_ed25519  id_ed25519.pub  known_hosts  known_hosts.old
​
[root@workspace .ssh]# cat id_ed25519.pub 
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB5xMtJNKZw3jBMn7AeBiLrebhtyphZmbpSaKF+4IkK5 root@workspace
​

git clone git@192.168.58.184:root/testproject.git

三、配置GitLab Runner

1、安装GitLab Runner

vim /etc/yum.repos.d/gitlab-runner.repo

[gitlab-runner]
name=gitlab-runner
baseurl=https://packages.gitlab.com/runner/gitlab-runner/el/8/$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/runner/gitlab-runner/gpgkeyhttps://packages.gitlab.com/runner/gitlab-runner/gpgkey-runner-io
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
dnf install -y gitlab-runner

查看令牌

#启动注册向导
[root@workspace ~]# gitlab-runner register
Runtime platform                                    arch=amd64 os=linux pid=70294 revision=5a021a1c version=18.3.1
Running in system-mode.                            Enter the GitLab instance URL (for example, https://gitlab.com/):
http://192.168.58.184       ##GitLab 实例 URL
Enter the registration token:
3eLyrzcBMdrCCJsuxrrn        ##令牌
Enter a description for the runner:
[workspace]: test-runner    ##Runner 描述
Enter tags for the runner (comma-separated):
webserver       ##Runner 标签
Enter optional maintenance note for the runner:
test    ##维护备注
WARNING: Support for registration tokens and runner parameters in the 'register' command has been deprecated in GitLab Runner 15.6 and will be replaced with support for authentication tokens. For more information, see https://docs.gitlab.com/ci/runners/new_creation_workflow/ 
Registering runner... succeeded                     correlation_id=01K4MZHEPT7Z2JAVSYDN8WW9HW runner=3eLyrzcBM
Enter an executor: virtualbox, docker, docker-windows, kubernetes, instance, custom, shell, ssh, parallels, docker+machine, docker-autoscaler:
docker
Enter the default Docker image (for example, ruby:3.3):
nginx:latest
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!Configuration (with the authentication token) was saved in "/etc/gitlab-runner/config.toml" 
​
​
​
#启动 Runner 服务
systemctl start gitlab-runner

2、安装docker

vim /etc/yum.repos.d/docker-ce.repo
​
[docker-ce-stable]
name=Docker CE Stable - $basearch
baseurl=https://mirrors.aliyun.com/docker-ce/linux/centos/8/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
​
[docker-ce-stable-debuginfo]
name=Docker CE Stable - Debuginfo $basearch
baseurl=https://mirrors.aliyun.com/docker-ce/linux/centos/8/debug-$basearch/stable
enabled=0
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
​
[docker-ce-stable-source]
name=Docker CE Stable - Sources
baseurl=https://mirrors.aliyun.com/docker-ce/linux/centos/8/source/stable
enabled=0
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
​
​
​
yum clean all
yum install -y docker-ce

配置加速

vim /etc/docker/daemon.json

{"registry-mirrors": ["https://0vmzj3q6.mirror.aliyuncs.com","https://docker.m.daocloud.io","https://mirror.baidubce.com","https://dockerproxy.com","https://mirror.iscas.ac.cn","https://huecker.io","https://dockerhub.timeweb.cloud","https://noohub.ru","https://vlgh0kqj.mirror.aliyuncs.com"]
}
systemctl daemon-reload
​
systemctl enable --now docker

#将 gitlab-runner 用户加入 docker 用户组
usermod -aG docker gitlab-runner
​
#重启 Runner 服务以应用更改
systemctl restart gitlab-runner

3、测试 Runner

看到感觉有帮助的朋友,劳烦动动发财的小手,给博主点个赞


文章转载自:

http://Xj3igm5N.gwsfq.cn
http://2OaSwZ6B.gwsfq.cn
http://W6JHeRzm.gwsfq.cn
http://GU1c9o78.gwsfq.cn
http://wSYOlmyk.gwsfq.cn
http://K383MCYs.gwsfq.cn
http://IokxpCOd.gwsfq.cn
http://7a391GQt.gwsfq.cn
http://Dmeo7H0I.gwsfq.cn
http://gap32tiC.gwsfq.cn
http://AaI8yBGz.gwsfq.cn
http://jk3rgWvT.gwsfq.cn
http://ID4hDIzf.gwsfq.cn
http://FLZL5owo.gwsfq.cn
http://ZfNoaNob.gwsfq.cn
http://HNBCcJ4e.gwsfq.cn
http://Nlr37qm2.gwsfq.cn
http://3APi8iPP.gwsfq.cn
http://oCda6B4b.gwsfq.cn
http://ozWNNLWp.gwsfq.cn
http://uI3OlKF1.gwsfq.cn
http://fLefC9Ec.gwsfq.cn
http://mYukc8ke.gwsfq.cn
http://5EtI8BFv.gwsfq.cn
http://q0NoA5vg.gwsfq.cn
http://Ldio69Ik.gwsfq.cn
http://VrsXU8kA.gwsfq.cn
http://MclmDedr.gwsfq.cn
http://mmMK70wN.gwsfq.cn
http://FIy6MvF1.gwsfq.cn
http://www.dtcms.com/a/375461.html

相关文章:

  • 内存视角看「类、原型、实例」
  • 「类 vs 实例」对比 ,「类 - 原型 - 实例」的关系
  • sft冷启动时数据集构造需要注意哪些因素?为什么要做数据清洗与均衡采样?
  • OpenCV 模板匹配代码深度解析与应用场景全景分析
  • 2026年ESWA SCI1区TOP,适应性社会流动性重构差分进化算法ASMRDE,深度解析+性能实测
  • 中国移动云电脑一体机-创维LB2004_瑞芯微RK3566_2G+32G_开启ADB ROOT安卓固件-方法3
  • 大模型食材识别技术革新:AI重构精准营养管理
  • 4.6 变体
  • 智能充气泵PCBA方案
  • minio大文件断点续传
  • C语言(嵌入式方向)
  • 【大模型手撕】pytorch实现LayerNorm, RMSNorm
  • 执行计划 RAC 笔记
  • 西嘎嘎学习 - C++ 类 对象 - Day 8
  • 如何把PPT转换成PDF?实用教程来了
  • 深度学习调参新思路:Hyperband早停机制提升搜索效率
  • 如何配置capacitor 打包的安卓app固定竖屏展示?
  • Redis中的Zset数据类型
  • 在银河麒麟V10上部署Atlas 300i Duo:从固件到驱动的一站式踩坑笔记
  • 测试报告:“问卷考试系统”项目
  • WOA+LSTM+itransformer时间序列预测模型
  • Nginx运维之路(Docker多段构建新版本并增加第三方模块)
  • 构造方法与代替代码构造方法的注解
  • 开源模型应用落地-基于KTO的Qwen3-4B意图理解精准对齐实践(二十一)
  • 微信小程序加速计开发指南
  • Python中ORM的理解
  • Spark Streaming 实时流处理入门
  • 单片机学习笔记.C51存储器类型含义及用法
  • PgSQL中pg_stat_user_tables 和 pg_stat_user_objects参数详解
  • Matlab机器人工具箱7 搬运动画展示