一、gitlab
1.获得gitlab安装包
2.安装依赖性
[root@code-node LLJ]# dnf install -y curl policycoreutils-python-utils openssh-server perl
3.安装软件
[root@code-node ~]# rpm -ivh gitlab-ce-19.4.0-ce.0.el9.x86_64.rpm
4.途中提示代码Please configure a URL for your GitLab instance by setting `external_url`configuration in /etc/gitlab/gitlab.rb file.
[root@code-node ~]# vim /etc/gitlab/gitlab.rb #修改IP地址
5.生效配置文件并开启gitlab
6.查看初始密码
7.访问并且输入初始密码登录
8.设置时区与语言,密码
9.在主机里生成密钥
[root@code-node ~]# cat .ssh/id_ed25519.pub#查看公钥
10.上传公钥
11.下载项目
12.模拟代码集成
[root@code-node LLJ]# git remote add origin http://172.25.254.30/root/llj.git#HTTP 模式
[root@code-node LLJ]# git remote remove origin#先删掉原来http的origin
[root@code-node LLJ]# git remote add origin git@172.25.254.30:root/llj.git#添加ssh地址(GitLab页面复制ssh链接)
[root@code-node LLJ]# git push -u origin master#推送
[root@code-node LLJ]# git branch -m master main#分支改名
二、jenkins
1.jenkins安装
[root@jenkins yum.repos.d]# wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/rpm/jenkins.repo
[root@jenkins yum.repos.d]# dnf install fontconfig java-21-openjdk
[root@jenkins yum.repos.d]# dnf install jenkins
[root@jenkins yum.repos.d]# systemctl enable --now jenkins
[root@jenkins yum.repos.d]# cat /var/lib/jenkins/secrets/initialAdminPassword
5c86bea9b15b45dbb8f0a0497b5bcca2
2.接下来访问网址+8080端口
下载所需要的插件在/var/lib/jenkins/plugins里