Linux deployment GitLab & idea connection

Overview

GitLab is an open source code management platform that uses Git as a version control tool and provides a web interface and multiple functions, such as wiki, issue tracking, CI/CD, etc.

GitLab can be self-hosted or use a SaaS service and supports a variety of operating systems and executors.

GitLab can help software development teams improve collaboration efficiency and quality.

Docker deployment GitLab

Docker installation:Install Pagoda panel and Docker (including MySQL, Redis) in CentOs7

Pull image

docker pull gitlab/gitlab-ce:latest

Start container

To run GitLab Community Edition in a container, run the GitLab CE image in the container and bind it to the host's 9980 and 9922 ports.

Store GitLab's configuration files, logs, and data files in the host's /home/gitlab/etc, /home/gitlab/log, and /home/gitlab/opt directories.

The container will automatically restart on startup and run in privileged mode.

docker run  -itd \
-p 9980:80 -p 9922:22 \
 -v /home/gitlab/etc:/etc/gitlab  \
 -v /home/gitlab/log:/var/log/gitlab \
 -v /home/gitlab/opt:/var/opt/gitlab \
 --restart always \
 --privileged=true \
 --name gitlab \
 gitlab/gitlab-ce

image-20231012212946349

Change setting

Get inside the container

docker exec -it gitlab /bin/bash

image-20231012213129869

# 修改 gitlab.rb,键盘按 i 进入编辑模式
vi /etc/gitlab/gitlab.rb
 
# 添加配置
# gitlab 访问地址,可以写域名。不写端口默认为 80 端口
external_url 'http://192.168.101.3' 
# ssh主机 ip
gitlab_rails['gitlab_ssh_host'] = '192.168.101.3'
# ssh 连接端口
gitlab_rails['gitlab_shell_ssh_port'] = 9922

image-20231012214419573

Esc,Import :wq,Save

image-20231012214513057

Running in Docker, the address of gitlab should be http:192.168.101.3

# 修改 http 和 ssh 配置
vi /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml

# 在 yml 修改
gitlab:
  host: 192.168.101.3
  port: 9980 # 端口改为9980
  https: false

image-20231012214557276

After the modification is completed, restart gitlab and then exit the container.

# 重启 gitlab
gitlab-ctl restart

# 退出容器
exit

image-20231012214633201

access

Browser access (http://<your ip address>:9980)

http://192.168.101.3:9980

image-20231012214857282

change Password

# 进入容器
docker exec -it gitlab /bin/bash

# 进入控制台
gitlab-rails console -e production

# 查询 id 为 1 的用户,id 为 1 的用户是超级管理员
user = User.where(id:1).first

# 修改密码为 gitlab
user.password='gitlab@2023'

# 保存
user.save!

# 退出
exit

image-20231012220153361

Log in

Log in to gitlab, username: root, password: gitlab@2023 (the value modified above)

image-20231012220237373

Related operations

Create project

upper right corner new Project

image-20231012220403340

Create a blank project

image-20231012220455130

Fill in the project name, related description, and visible range, and click Create project Create Project

image-20231012220653743

Created successfully

image-20231012220737078

idea connect gitlab

Idea is out in version 2023. The new UI of idea is used below. Now use idea to connect to gitlab to complete the push of the code.

image-20231012222735411

Submit code

image-20231012222838477

Connect to the gitlab remote repository, right-click on the project, select Git, and select Manage Repository

image-20231012223933987

Enter the url, click ok, and the url is obtained in gitlab

Port 9980 is missing here, it is actually http://192.168.101.3:9980/root/gitlab-test-demo.git

image-20231012224241593

url pay attention to add the port

image-20231012224342153

Enter username and password to log in

image-20231012224430249

connection succeeded

image-20231012224452655

Click the local master and click push. You can also right-click the project, find Git, and select push.

image-20231012224552130

Click push

image-20231012224612143

You can view the project content in gitlab. By default, gitlab is the branch of main. When you pushed just now, you pushed to the master of gitlab, so first modify the branch to master, and then you can see the project code.

image-20231012224747855

At the same time, you can also view the submission status of the remote warehouse in idea

image-20231012224823154

at last

nightingale monitoring

Recommend to everyone a cloud-native monitoring and analysis system - Nightingale Monitoring

Nightingale Monitoring is a domestic, open-source, cloud-native monitoring and analysis system that adopts an All-In-One design and integrates data collection, visualization, monitoring and alarming, and data analysis. It was developed and open sourced by Didi, and was donated to the China Computer Federation Open Source Development Committee (CCF ODC) on May 11, 2022, becoming the first open source project to receive donations after the establishment of CCF ODC.

The core development team of Nightingale Monitor is also the original core developer of the Open-Falcon project. It supports multiple data collection methods, including Agent, SNMP, JMX, etc. At the same time, it also supports a variety of alarm methods, including email, SMS, WeChat, etc. Nightingale Monitoring provides a wealth of visual charts and dashboards to help users better understand monitoring data.

Install

Use docker-compose to deploy, and githubfast is recommended for cloning.

# 使用 github 克隆
git clone https://github.com/ccfos/nightingale.git
cd nightingale/docker

# 考虑到 github 访问可能不通,这里推荐使用 githubfast
git clone https://githubfast.com/ccfos/nightingale.git

# 进入项目中
cd nightingale/docker

# 启动 Docker Compose 配置文件中定义的所有服务
# up 用于创建并启动容器
# -d 有台运行
docker-compose up -d

Appears after success

image-20231012231351396

access

Remember to open the firewall if access is blocked

address:http://192.168.101.3:17000

Purchase number:root ,Secret number:root.2020

Linux open port related commands

Open the specified port (to reload the firewall)

firewall-cmd --zone=public --add-port=17000/tcp --permanent

Reload firewall

firewall-cmd --reload

Enter the login page

image-20231012232410129

Enter your account password to enter the background

image-20231012232439021

other

The server in this article uses the virtual machine CentOS7.9. For the process of building a virtual machine, please refer to the column.

Linux column (including virtual machine installation, CentOS installation, Docker installation, deployment project)

For information on gitee warehouse operations, please view articles

gitee creates repository & git connection

Guess you like

Origin blog.csdn.net/weixin_62726289/article/details/133801428