一、gitlab1.获得gitlab安装包官方包地址https://packages.gitlab.com/gitlab/gitlab-ce2.安装依赖性[rootcode-node LLJ]# dnf install -y curl policycoreutils-python-utils openssh-server perl3.安装软件[rootcode-node ~]# rpm -ivh gitlab-ce-19.4.0-ce.0.el9.x86_64.rpm4.途中提示代码Please configure a URL for your GitLab instance by setting external_urlconfiguration in /etc/gitlab/gitlab.rb file.[rootcode-node ~]# vim /etc/gitlab/gitlab.rb #修改IP地址5.生效配置文件并开启gitlab[rootcode-node ~]# gitlab-ctl reconfigure6.查看初始密码[rootcode-node ~]# cat /etc/gitlab/initial_root_password7.访问并且输入初始密码登录8.设置时区与语言密码9.在主机里生成密钥[rootcode-node ~]# ssh-keygen[rootcode-node ~]# ls .ssh/[rootcode-node ~]# cat .ssh/id_ed25519.pub#查看公钥10.上传公钥11.下载项目12.模拟代码集成[rootcode-node LLJ]# git remote -v#查看已经绑定的远程仓库[rootcode-node LLJ]# git remote add origin http://172.25.254.30/root/llj.git#HTTP 模式[rootcode-node LLJ]# git remote remove origin#先删掉原来http的origin[rootcode-node LLJ]# git remote add origin git172.25.254.30:root/llj.git#添加ssh地址GitLab页面复制ssh链接[rootcode-node LLJ]# git push -u origin master#推送[rootcode-node LLJ]# git branch -m master main#分支改名git pull origin main --allow-unrelated-histories#允许合并无关历史二、jenkins1.jenkins安装[rootjenkins yum.repos.d]# wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/rpm/jenkins.repo[rootjenkins yum.repos.d]# dnf install fontconfig java-21-openjdk[rootjenkins yum.repos.d]# dnf install jenkins[rootjenkins yum.repos.d]# systemctl enable --now jenkins[rootjenkins yum.repos.d]# cat /var/lib/jenkins/secrets/initialAdminPassword5c86bea9b15b45dbb8f0a0497b5bcca22.接下来访问网址8080端口下载所需要的插件在/var/lib/jenkins/plugins里