运维从0开始学习jenkins

0、背景

想要学会jenkins运维,了解相关概念。

1、gitbal 服务端安装配置

Gitlab安装
1. 安装相关依赖
    yum -y install policycoreutils openssh-server openssh-clients postfix
2. 启动ssh服务&设置为开机启动
    systemctl enable sshd && sudo systemctl start sshd
3. 设置postfix开机自启,并启动,postfix支持gitlab发信功能
    systemctl enable postfix && systemctl start postfix
4. 开放ssh以及http服务,然后重新加载防火墙列表
    firewall-cmd --add-service=ssh --permanent
    firewall-cmd --add-service=http --permanent
    firewall-cmd --reload
5. 下载安装(不行就直接复制链接)
    wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-17.1.1-ce.0.el7.x86_64.rpm
    # rpm -ivh gitlab-ce-17.1.1-ce.0.el7.x86_64.rpm
    yum install gitlab-ce-17.1.1-ce.0.el7.x86_64.rpm

6. 修改gitlab配置
    vi /etc/gitlab/gitlab.rb
    修改gitlab访问地址和端口,默认为80,我们改为82
    external_url 'http://192.168.66.100:82'
    nginx['listen_port'] = 82
7. 重载配置及启动gitlab
    gitlab-ctl reconfigure
    gitlab-ctl restart
8. 把端口添加到防火墙
    firewall-cmd --zone=public --add-port=82/tcp --permanent
    firewall-cmd --reload
    启动成功后,默认用户为 root  密码为 /etc/gitlab/init_password 文件

2、IDEA push 到 gitlab

创建第一个IDEA项目:https://www.jetbrains.com/zh-cn/help/idea/2025.1/creating-and-running-your-first-java-application.html#run_app

idea提交到gitlab上:https://cloud.tencent.com/developer/article/1735099

3、jenkins 安装与使用

 

posted @ 2026-01-20 17:24  郭大侠1  阅读(0)  评论(0)    收藏  举报