1.基本情報
Gogsの目標は、セルフサービスのGitサービスを構築するための最も簡単で最速かつ最も簡単な方法を作成することです。Go言語開発を使用すると、Gogsを独立したバイナリで配布でき、Linux、Mac OS X、Windows、ARMプラットフォームなど、Go言語でサポートされているすべてのプラットフォームをサポートします。
公式サイト:https://gogs.io/
ドキュメント:https://gogs.io/docs
Github:https://github.com/gogs/gogs
ダウンロードリンク:https://dl.gogs.io/
公式インストールドキュメント:https://gogs.io/docs/installation/install_from_binary
2.システム環境とツール
1.システムの説明
システム:CentOS-7-x86_64-Minimal-1708
ダウンロードリンク:
http://mirrors.aliyun.com/centos/
2.仮想マシンをインストールします
仮想マシンをインストールします:2Gメモリ、1コアCPU
インストールプロセスを参照してください。
https://blog.csdn.net/llwy1428/article/details/89328381
3. VMwareバージョン:VMware Workstation Pro15
4.ツール:xshell5
3、インストールと展開
1.システムユーザーgitを作成します
[root @ localhost〜] #useradd git
2.PostgreSqlデータベースをインストールします
インストールプロセスを参照してください。
https://blog.csdn.net/llwy1428/article/details/102486414
https://blog.csdn.net/llwy1428/article/details/105143053
3.データベースゴグを作成します
ユーザーの切り替え
[root@localhost ~]# su - postgres
-bash-4.2$ psql
コマンドを実行してデータベースを作成します
postgres=# create database gogs owner postgres;
4.rootユーザーでインストーラーをダウンロードします
ダウンロードリンク:https://dl.gogs.io/
[root@localhost ~]# cd /home/git
下载
[root@localhost git]# wget https://dl.gogs.io/0.12.1/gogs_0.12.1_linux_amd64.tar.gz
给文件赋权
[root@localhost ~]# chown git:git /home/git/gogs_0.12.1_linux_amd64.tar.gz
5.ユーザーを切り替え、ファイルを解凍して表示します
[root@localhost ~]# su git
回到根目录
[git@localhost ~]# cd
解压文件
[git@localhost ~]$ tar zxvf gogs_0.12.1_linux_amd64.tar.gz
查看
[git@localhost ~]# ll
drwxrwxr-x. 3 git git 85 Aug 27 15:07 gogs
-rwxrwxrwx. 1 git git 27492538 Aug 27 15:08 gogs_0.12.1_linux_amd64.tar.gz
查看gogs文件夹
[git@localhost ~]$ ll gogs
total 48912
-rwxrwxr-x. 1 git git 50063136 Aug 27 15:07 gogs
-rw-rw-r--. 1 git git 1054 Aug 27 15:07 LICENSE
-rw-rw-r--. 1 git git 7021 Aug 27 15:07 README.md
-rw-rw-r--. 1 git git 5372 Aug 27 15:07 README_ZH.md
drwxrwxr-x. 7 git git 195 Aug 27 15:07 scripts
6、サービスを開始します
コンソールが起動します。
[git @ localhost gogs] $ ./gogs web
バックグラウンドガードが開始します。
[git @ localhost〜] $ nohup gogs / gogs web&
7.起動ステータスを確認します。
4、ブラウザビュー、初期化
1.ブラウザにアドレスを入力します
http://192.168.11.20:3000/(192.168.11.20 は私の仮想マシンのIPです)
2.データベースとシステムユーザー情報を入力します
3.管理者ユーザーによって作成されます。最初に作成されるアカウントは管理者アカウントであり、通常のユーザーの権限を持っています。
4.アカウントを登録します。「admin」は使用できませんのでご注意ください
5.ログイン
6.ホーム
7.作業指示管理
8.発見
9.倉庫を作成します
10.倉庫を確認します
オペレーティング:
[git@localhost ~]$ mkdir base
[git@localhost ~]$ cd base
[git@localhost base]$ git init
Initialized empty Git repository in /home/git/base/.git/
[git@localhost base]$ git add README.md
[git@localhost base]$ git commit -m "first commit"
[master (root-commit) 40c5502] first commit
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 README.md
[git@localhost base]$ git remote add origin http://192.168.11.30:3000/sysadmin/base.git
[git@localhost base]$ git push -u origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 205 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
Username for 'http://192.168.11.30:3000': sysadmin
Password for 'http://[email protected]:3000':
To http://192.168.11.30:3000/sysadmin/base.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.
見る
この時点で、Centos7のインストールと展開のgogs-v0.12.1が完了しました。
参照アドレス:
https://www.linuxidc.com/Linux/2016-04/130600.htm
https://www.tisnz.com/2019/04/03/gogs-install/
https://blog.csdn.net/wangt5952/article/details/96423757
https://www.jianshu.com/p/5686a2d768f8