Huawei Cloud Yunyao Cloud Server L instance evaluation | Yunyao Cloud Server L instance deploys Gitblit server

1. Introduction to Yunyao Cloud Server L Instance

1.1 Introduction to Yunyao Cloud Server L instance

Yunyao Cloud Server L instance is a new generation of lightweight application cloud server, specially designed for small and medium-sized enterprises and developers, providing a convenient out-of-box experience. This product provides rich and strictly screened application images and can deploy applications with one click, greatly simplifying the process of customers building e-commerce websites, web applications, applets, learning environments, and various development and testing tasks in the cloud.

Insert image description here

1.2 Features of Yunyao Cloud Server L instance

  • Intelligent and non-stuck: Huawei Cloud Qingtian architecture supports software and hardware collaboration combined with AI algorithm intelligent scheduling to provide you with high-quality performance. Huawei Cloud has a global storage and computing network with data transmission latency shorter than the blink of an eye, meeting the high requirements of low network latency scenarios such as games and audio and video.

  • Excellent price, easy to use: super cost-effective, ultra-low threshold, open to use as you like. Multiple instance specifications to balance performance and cost. Technology upgrades optimize cloud costs and benefit more start-ups and developers.

  • It’s easier to get started: order multiple images and resource combinations with one click. A variety of high-quality images have been carefully selected and rigorously tested by Huawei Cloud officials. They cover seven major scenarios and have preset templates, which are quick to build, safe and trustworthy. Automated orchestration, one-click activation of resources, and business online in minutes. Smooth learning curve, wizard-based application construction, and easy application activation.

  • Management is more worry-free: topology, resources, and mirroring are managed visually, and business architecture is transparently managed. Intimate service status reminders, one-click resource renewal and withdrawal, and simplified management. Real-time monitoring of resource load, security, and usage ensures that services are always online. A wide range of optional security services are available, including extensive backup, host security and other services, providing the highest level of security protection.

2. Introduction to Gitblit

2.1 Introduction to Gitblit

Gitblit is an open source, pure Java Git solution for managing, viewing, and serving Git repositories. It can transfer service repositories through GIT, HTTP and SSH, and serves as a Git-based code hosting and team collaboration tool.

2.2 Gitblit features

  • Easy to install and configure: Gitblit has simple and easy installation and configuration, and can be easily installed and used on multiple operating systems such as Windows, Linux, and Mac.

  • Web interface: Gitblit provides a simple yet powerful web interface that allows team members to easily browse the code, submit and merge requests, view history, and more.

  • Distributed: Gitblit is based on Git, so it has the advantages of Git's distributed version control, such as supporting fast branch and merge operations, local submission, etc.

  • Security: Gitblit provides security features such as user management, permission management, and SSL encryption to ensure the security and privacy of the code repository.

  • Customizability: Gitblit provides a pluggable plug-in system and custom script functions that users can easily extend and customize according to their own needs.

  • Scalability: Gitblit can be integrated with other tools, such as Jenkins, JIRA, Redmine, etc., to support larger-scale software development and collaboration.

3. Introduction to this practice

3.1 Introduction to this practice

1. This practice is a personal test learning environment, aiming to quickly deploy applications. Please be cautious in the production environment;
2. This practice environment is a Yunyao Cloud Server L instance, and the application image used is Portainer 2.18.4;
3. Due to the use The application image is Portainer, and the cloud server has automatically deployed the Docker environment;
4. Deploy the Gitblit server on the Huawei Cloud Cloud Server L instance.

3.2 This environmental plan

Server category Application image Intranet IP address Docker version Portainer version
Yunyao cloud server L instance Docker visualization Portainer 192.168.0.168 24.0.4 2.18.4

4. Check the server environment

4.1 Purchase Yunyao Cloud Server L instance

  • Purchase steps:

1. Official website link: https://www.huaweicloud.com/product/hecs-light.html
2. Purchase specifications:
Region: North China-Beijing IV;
Application image: Docker visualization-Portainer;
Instance specifications: 2 cores 2G/system Disk 40G/peak bandwidth 3Mbps/traffic package 400G;
instance name: Customize it, edit it here as HECS-L-Portainer;
purchase duration: 1 month.

  • Just pay after selecting the specifications.

Insert image description here

4.2 Remote connection to server

Use Xshell to connect to the server remotely and fill in the elastic public IP address of the Yunyao Cloud Server L instance, the server account password.

Insert image description here

4.3 Check operating system version

Check the operating system version of the Yunyao Cloud Server L instance. When using the Portainer application image, the operating system version is Ubuntu 22.04.1 LTS.

root@hcss-ecs-f91c:~# cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

4.4 Check system kernel version

Check the kernel version of Yunyao Cloud Server L instance.

root@hcss-ecs-f91c:~# uname -r
5.15.0-60-generic

4.5 Check Docker version

Since the Docker environment has been automatically installed when the Yunyao Cloud Server L instance uses the portainer application image, we can use the Docker environment directly.

root@hcss-ecs-f91c:~# docker version
Client: Docker Engine - Community
 Version:           24.0.4
 API version:       1.43
 Go version:        go1.20.5
 Git commit:        3713ee1
 Built:             Fri Jul  7 14:50:55 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          24.0.4
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.5
  Git commit:       4ffc614
  Built:            Fri Jul  7 14:50:55 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:        v1.1.7-0-g860f061
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

4.6 Check Docker service status

Check the Docker service status to ensure that the Docker service is running normally.

root@hcss-ecs-f91c:~# systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2023-09-21 20:08:30 CST; 1 day 18h ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 16852 (dockerd)
      Tasks: 84
     Memory: 61.8M
        CPU: 1min 55.913s
     CGroup: /system.slice/docker.service

4.7 Check docker compose version

Check the version of docker compose that comes with the Docker service.

root@hcss-ecs-f91c:~# docker compose version
Docker Compose version v2.19.1

5. Deploy Gitblit server

5.1 Download the Gitblit image

Pull the Gitblit image from docker hub. The image used is jacekkow/gitblit:v1.9.1.

root@hcss-ecs-f91c:~#  docker pull jacekkow/gitblit:v1.9.1
v1.9.1: Pulling from jacekkow/gitblit
57df1a1f1ad8: Pull complete
71e126169501: Pull complete
1af28a55c3f3: Pull complete
a9777c2d5c29: Pull complete
9248106993db: Pull complete
1f74ab5b5b3e: Pull complete
f33944599fe3: Pull complete
3ec5e998e40a: Pull complete
3a0313c9dd93: Pull complete
f2c7438691bf: Pull complete
Digest: sha256:d683b5e04f737315f047baec795d70bb21fa1a0ef8a8956044694f96c6c2f677
Status: Downloaded newer image for jacekkow/gitblit:v1.9.1
docker.io/jacekkow/gitblit:v1.9.1

5.2 Create mounting directory

Create the mounting directory /data/gitblit/.

root@hcss-ecs-f91c:~# mkdir -p /data/gitblit
root@hcss-ecs-f91c:~# cd /data/gitblit/

5.3 Create Gitblit container

Use docker-cli to quickly create Gitblit containers.

 docker run -d --name gitblit \
 --restart always \
 -p 8388:8080 \
 -p 8443:8443  \
 -p 9418:9418  \
 -p 29418:29418  \
 -v /data/gitblit/data:/opt/gitblit-data \
  jacekkow/gitblit:v1.9.1

Insert image description here

In the jacekkow/gitblit:v1.9.1 container image, the four exposed ports are 8080, 8443, 9418 and 29418. Their meanings are as follows:
8080: The port listened by the Gitblit HTTP server, which is used to provide a web-based Git warehouse browser and management interface.
8443: The port monitored by the Gitblit HTTPS server, which is used to provide a web-based Git warehouse browser and management interface, and all communications are encrypted.
9418: The default port of the Git protocol, used for communication between Git client and Git server.
29418: Gerrit's SSH listening port, used for authentication and data transfer between Gerrit administrators and contributors, usually used for code review and merging code.

5.4 Check Gitblit container status

Check the status of the Gitblit container to ensure that the Gitblit container starts normally.

root@hcss-ecs-f91c:/data/gitblit# docker ps
CONTAINER ID   IMAGE                           COMMAND                  CREATED          STATUS          PORTS                                                                                                           NAMES
f00e6c3f6cec   jacekkow/gitblit:v1.9.1         "/bin/sh -c /run.sh"     22 minutes ago   Up 22 minutes   0.0.0.0:8443->8443/tcp, :::8443->8443/tcp, 0.0.0.0:9418->9418/tcp, :::9418->9418/tcp, 0.0.0.0:29418->29418/tcp, :::29418->29418/tcp, 0.0.0.0:8388->8080/tcp, :::8388->8080/tcp   gitblit

5.5 Check Gitblit container logs

Check the Gitblit container log to ensure that Gitblit is running normally.

docker logs gitblit

Insert image description here

6. Access the Gitblit server

6.1 Release security group ports

Enter the security group management page of Yunyao Cloud Server L instance and allow port 8388/8443/9418/29418 in the inbound direction.

Insert image description here

6.2 Access Gitblit server through http method

Access address: http://Elastic public IP address: 8388, default account password admin/admin.

Insert image description here

6.3 Access Gitblit server via https

Access address: https://Elastic public IP address: 8443, default account password admin/admin.

Insert image description here

7. Basic use of Gitblit

7.1 Create a warehouse

In the settings menu in the upper right corner, click Create repository.

Insert image description here

Set the repository name, select the access policy, and customize the rest as needed.

Insert image description here
Insert image description here

7.2 Local server git operation

  • Configure local Git repository initialization information
git config --global user.name "wangming"
git config --global user.email "[email protected]"
git config --global color.ui true
  • View Git configuration information
root@hcss-ecs-f91c:/mygit# cat ~/.gitconfig
[user]
	name = wangming
	email = 123456@qq.com
[color]
	ui = true
  • Create workspace
root@hcss-ecs-f91c:/mygit# git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: 	git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: 	git branch -m <name>
Initialized empty Git repository in /mygit/.git/
  • Create files in workspace
echo "ECS-test01-V01"  > test.txt
  • Upload files to local repository
 git add .
git commit -m "1.0 master-wangming create item for test scripts  "

Insert image description here

7.2 Configure remote warehouse

  • Add the remote warehouse address and replace the IP with your own server IP address.
git remote add origin https://[email protected]:8443/r/my-gitblit.git
  • View connection status
 git remote -v

Insert image description here

7.3 Push code to GitBlit server

  • Execute the following command:
git config --global http.sslverify false
git config --global https.sslverify false
  • Pull code
git pull --rebase origin master
  • Use the git push command to upload test files to the GitBlit repository.
 git push -u origin master

Insert image description here

7.4 View Gitblit server

Check the my-gitblit version repository of the Gitblit server and you can see that the test file has been successfully uploaded.

Insert image description here
Insert image description here
Insert image description here

Guess you like

Origin blog.csdn.net/jks212454/article/details/133206253
Recommended