Centos8 installing gogs code warehouse management tool

Time:2021-5-4

The goal of gogs is to build a self-service git service in the simplest, fastest and easiest way. Using go language development enables gogs to be distributed through independent binary, and supports all platforms supported by go language, includingLinux, Mac OS X, windows and arm platforms.

environment

Create git users

[[email protected] ~]# useradd git
[[email protected] ~]# echo ‘123456’|passwd –stdin git
Changing password for user git.
passwd: all authentication tokens updated successfully.

Setting sudo for git users

[[email protected] ~]# visudo
git ALL=(ALL) NOPASSWD: ALL

Centos8 installing gogs code warehouse management tool

Download and configure the basic environment

[[email protected] ~]# yum -y install tar wget git mariadb mariadb-server

Set MariaDB to start, and start MariaDB service

[[email protected] ~]# systemctl enable mariadb –now

Create gogs database

Switch to git user

[[email protected] ~]# su – git

Create database

[[email protected] ~]$ mysql -u root -e “CREATE DATABASE IF NOT EXISTS gogs CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;”

[[email protected] ~]$ mysql -u root -e “show databases;”
Database
gogs
information_schema
mysql
performance_schema

Centos8 installing gogs code warehouse management tool
Create database gogs user and grant access to gogs database:

[[email protected] ~]$ mysql -u root -e “create user gogs; grant all privileges on gogs.* to [email protected]’%’ identified by ‘gogs123’;”

Check whether the user gogs is added and whether all access rights are granted.

[[email protected] ~]$ mysql -u root -e “select Host,User,Password from mysql.user; show grants for [email protected]’%’;”

Centos8 installing gogs code warehouse management tool

Download gogs installation package

From the website of gogshttps://gogs.io/docs/installa…Download the installation package of the corresponding operating system.
Centos8 installing gogs code warehouse management tool

[[email protected] ~]$ wget https://dl.gogs.io/0.11.91/go…
[[email protected] ~]$ tar xvf gogs_0.11.91_linux_amd64.tar.gz

Start gogs and open the port of firewall

[[email protected] gogs]$ sudo firewall-cmd –permanent –add-port=3000/tcp
success
[[email protected] gogs]$ sudo firewall-cmd –reload
success
[[email protected] ~]$ /home/git/gogs/gogs web

Centos8 installing gogs code warehouse management tool
Open the browser and enter the IP address of the server. The port is 3000. Database user and password, using just created“ Use “URL” to fill in the IP address of the gogs server. Then click Install now.

Centos8 installing gogs code warehouse management tool
After that, enter the login interface, and we can create a new user.

Centos8 installing gogs code warehouse management tool
Enter the registration page to register users.

Centos8 installing gogs code warehouse management tool
After registration, log in, we can click my warehouse and create the first one.

Centos8 installing gogs code warehouse management tool

Centos8 installing gogs code warehouse management tool
Copy the warehouse address, and then download the warehouse from your own operating system

Centos8 installing gogs code warehouse management tool
Create a description file in the warehouse and upload it to the remote warehouse.

[[email protected] ~]# git clone http://192.168.60.137:3000/user01/example01.git
Cloning into ‘example01’…
warning: You appear to have cloned an empty repository.
[[email protected] ~]# cd example01/
[[email protected] example01]# echo “This is example01’s README” > README.md
[[email protected] example01]# git add .
[[email protected] example01]# git config –global user.name user01
[[email protected] example01]# git config –global user.email [email protected]
[[email protected] example01]# git commit -m “add a README.md”
[master (root-commit) 9d7df1d] add a README.md
1 file changed, 1 insertion(+)
create mode 100644 README.md
[[email protected] example01]# git push
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 240 bytes | 240.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
Username for ‘http://192.168.60.137:3000′: user01
Password for ‘http://[email protected]:3000′:
To http://192.168.60.137:3000/user01/example01.git

  • [new branch] master -> master

The upload is successful in the remote warehouse.
Centos8 installing gogs code warehouse management tool

summary

Gogs can also be deployed by using docker, vagrant and helm charts based on kubernetes.

Recommended Today

Large scale distributed storage system: Principle Analysis and architecture practice.pdf

Focus on “Java back end technology stack” Reply to “interview” for full interview information Distributed storage system, which stores data in multiple independent devices. Traditional network storage system uses centralized storage server to store all data. Storage server becomes the bottleneck of system performance and the focus of reliability and security, which can not meet […]