日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux安装配置软件厂库,Centos8 安装 Gogs 代码仓库管理工具

發(fā)布時間:2024/3/24 linux 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux安装配置软件厂库,Centos8 安装 Gogs 代码仓库管理工具 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

Gogs 的目標(biāo)是打造一個最簡單、最快速和最輕松的方式搭建自助 Git 服務(wù)。使用 Go 語言開發(fā)使得 Gogs 能夠通過獨(dú)立的二進(jìn)制分發(fā),并且支持 Go 語言支持的所有平臺,包括Linux、Mac OS X、Windows 以及 ARM 平臺。

環(huán)境

gogs_0.11.91

創(chuàng)建git用戶

[root@localhost ~]# useradd git

[root@localhost ~]# echo '123456'|passwd --stdin git

Changing password for user git.

passwd: all authentication tokens updated successfully.

為git用戶設(shè)置sudo

[root@localhost ~]# visudo

git ALL=(ALL) NOPASSWD: ALL

下載并配置基本環(huán)境

[root@localhost ~]# yum -y install tar wget git mariadb mariadb-server

設(shè)置mariadb開機(jī)啟動,并啟動mariadb服務(wù)

[root@localhost ~]# systemctl enable mariadb --now

創(chuàng)建gogs數(shù)據(jù)庫

# 切換到git用戶

[root@localhost ~]# su - git

# 創(chuàng)建數(shù)據(jù)庫

[git@localhost ~]$ mysql -u root -e "CREATE DATABASE IF NOT EXISTS gogs CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"

[git@localhost ~]$ mysql -u root -e "show databases;"

+--------------------+

| Database |

+--------------------+

| gogs |

| information_schema |

| mysql |

| performance_schema |

+--------------------+

創(chuàng)建數(shù)據(jù)庫gogs用戶,并授予訪問gogs數(shù)據(jù)庫權(quán)限:

[git@localhost ~]$ mysql -u root -e "create user gogs; grant all privileges on gogs.* to gogs@'%' identified by 'gogs123';"

# 查看用戶gogs是否添加,是否授予所有訪問權(quán)。

[git@localhost ~]$ mysql -u root -e "select Host,User,Password from mysql.user; show grants for gogs@'%';"

下載gogs安裝包

從gogs的官網(wǎng) https://gogs.io/docs/installation/install_from_binary 下載對應(yīng)操作系統(tǒng)的安裝包。

[git@localhost ~]$ wget https://dl.gogs.io/0.11.91/gogs_0.11.91_linux_amd64.tar.gz

[git@localhost ~]$ tar xvf gogs_0.11.91_linux_amd64.tar.gz

啟動gogs并開放防火墻的端口

[git@localhost gogs]$ sudo firewall-cmd --permanent --add-port=3000/tcp

success

[git@localhost gogs]$ sudo firewall-cmd --reload

success

[git@localhost ~]$ /home/git/gogs/gogs web

打開瀏覽器輸入服務(wù)器的ip地址,端口是3000。數(shù)據(jù)庫用戶和密碼,使用剛才創(chuàng)建的?!皯?yīng)用URL”填寫gogs服務(wù)器的ip地址。然后點(diǎn)擊立即安裝。

之后,進(jìn)入登錄界面,我們可以創(chuàng)建一個新用戶。

進(jìn)入注冊頁面,注冊用戶。

注冊完成,登錄進(jìn)去,我們可以點(diǎn)我的倉庫,創(chuàng)建第一個倉庫。

復(fù)制倉庫地址,然后再自己的操作系統(tǒng)中下載該倉庫

在倉庫中創(chuàng)建一個描述文件,并上傳到遠(yuǎn)程倉庫中。

[root@localhost ~]# git clone http://192.168.60.137:3000/user01/example01.git

Cloning into 'example01'...

warning: You appear to have cloned an empty repository.

[root@localhost ~]# cd example01/

[root@localhost example01]# echo "This is example01's README" > README.md

[root@localhost example01]# git add .

[root@localhost example01]# git config --global user.name user01

[root@localhost example01]# git config --global user.email user01@example.com

[root@localhost 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

[root@localhost 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://user01@192.168.60.137:3000':

To http://192.168.60.137:3000/user01/example01.git

* [new branch] master -> master

遠(yuǎn)程倉庫中可以看到上傳成功。

總結(jié)

部署Gogs的方式還有可以使用Docker、Vagrant、基于 Kubernetes 的 Helm Charts等方式安裝。

總結(jié)

以上是生活随笔為你收集整理的linux安装配置软件厂库,Centos8 安装 Gogs 代码仓库管理工具的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。