Skip to content
This repository was archived by the owner on Dec 2, 2017. It is now read-only.

Commit aa59d4e

Browse files
authored
Merge pull request #44 from appleboy/install
add installation for zh-tw language.
2 parents 0c5db9b + 4b2e0a2 commit aa59d4e

File tree

6 files changed

+246
-0
lines changed

6 files changed

+246
-0
lines changed

content/doc/installation.zh-tw.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
date: "2016-12-01T16:00:00+02:00"
3+
title: "安裝"
4+
slug: "installation"
5+
weight: 10
6+
toc: false
7+
draft: false
8+
menu:
9+
sidebar:
10+
name: "安裝"
11+
weight: 10
12+
identifier: "installation"
13+
---
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
date: "2016-12-01T16:00:00+02:00"
3+
title: "執行檔安裝"
4+
slug: "install-from-binary"
5+
weight: 10
6+
toc: true
7+
draft: false
8+
menu:
9+
sidebar:
10+
parent: "installation"
11+
name: "執行檔"
12+
weight: 20
13+
identifier: "install-from-binary"
14+
---
15+
16+
# 從執行檔安裝
17+
18+
所有的執行檔皆支援 SQLite, MySQL and PostgreSQL,且所有檔案都已經包在執行檔內,這一點跟之前的版本有所不同。關於執行檔的安裝方式非常簡單,只要從[下載頁面](https://dl.gitea.io/gitea)選擇相對應平台,複製下載連結,使用底下指令就可以完成了:
19+
20+
```
21+
wget -O gitea https://dl.gitea.io/gitea/1.0.0/gitea-1.0.0-linux-amd64
22+
chmod +x gitea
23+
```
24+
25+
## 測試
26+
27+
執行完上述步驟,您將會得到 `gita` 執行檔,在複製到遠端伺服器前,您可以先測試看看,在命令列執行完成後,可以透過 `Ctrl + C` 關閉程式。
28+
29+
```
30+
./gitea web
31+
```
32+
33+
## 需要協助?
34+
35+
如果本頁中無法解決您的問題,請直接到 [Gitter channel](https://gitter.im/go-gitea/gitea/),在那邊可以快速得到協助。
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
date: "2016-12-01T16:00:00+02:00"
3+
title: "套件安裝"
4+
slug: "install-from-package"
5+
weight: 10
6+
toc: true
7+
draft: false
8+
menu:
9+
sidebar:
10+
parent: "installation"
11+
name: "套件安裝"
12+
weight: 20
13+
identifier: "install-from-package"
14+
---
15+
16+
# 從套件安裝
17+
18+
## Linux
19+
20+
目前尚未發佈任何 Linux 套件,如果我們發佈了,會直接更新此網頁。在這之前請先參考[執行檔安裝]({{< relref "from-binary.zh-tw.md" >}})方式。
21+
22+
## Windows
23+
24+
目前尚未發佈任何 Windows 套件,如果我們發佈了,會直接更新此網頁。我們計畫使用 `MSI`,或 [Chocolatey](https://chocolatey.org/) 來製作套件。在這之前請先參考[執行檔安裝]({{< relref "from-binary.zh-tw.md" >}})方式。
25+
26+
## macOS
27+
28+
目前我們只支援透過 `brew` 來安裝套件。假如您尚未使用 [Homebrew](http://brew.sh/),您就必須參考[執行檔安裝]({{< relref "from-binary.zh-tw.md" >}})方式。透過 `brew` 安裝 Gitea,您只需要執行底下指令:
29+
30+
```
31+
brew tap go-gitea/gitea
32+
brew install gitea
33+
```
34+
35+
## FreeBSD
36+
37+
下載 FreeBSD port `www/gitea` 套件。你可以安裝 pre-built 執行檔:
38+
39+
```
40+
pkg install gitea
41+
```
42+
43+
對於最新版本或想要自行編譯特定選項,請使用 [port 安裝](https://www.freebsd.org/doc/handbook/ports-using.html):
44+
45+
```
46+
su -
47+
cd /usr/ports/www/gitea
48+
make install clean
49+
```
50+
51+
## 需要協助?
52+
53+
如果本頁中無法解決您的問題,請直接到 [Gitter channel](https://gitter.im/go-gitea/gitea/),在那邊可以快速得到協助。
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
date: "2016-12-01T16:00:00+02:00"
3+
title: "原始碼安裝"
4+
slug: "install-from-source"
5+
weight: 10
6+
toc: true
7+
draft: false
8+
menu:
9+
sidebar:
10+
parent: "installation"
11+
name: "原始碼安裝"
12+
weight: 30
13+
identifier: "install-from-source"
14+
---
15+
16+
# 從原始碼安裝
17+
18+
我們不會在本文教大家如何安裝 Golang 環境。假如您不知道如何設定環境,請直接參考[官方安裝文件](https://golang.org/doc/install)
19+
20+
## 下載
21+
22+
首先您必須先下載原始碼,最簡單的方式就是透過 Go 指令下載,請透過底下指令下載原始碼並且切換到工作目錄。
23+
24+
```
25+
go get -d -u code.gitea.io/gitea
26+
cd $GOPATH/src/code.gitea.io/gitea
27+
```
28+
29+
現在該決定您要編譯或安裝的 Gitea 版本,您有很多可以選擇。如果您想編譯 `master` 版本,你可以直接跳到[編譯章節](#build),這是我們開發分支,雖然很穩定,但是不建議用在正式環境。
30+
31+
假如您想要編譯最新穩定版本,可以執行底下命令切換到正確版本:
32+
33+
```
34+
git branch -a
35+
git checkout v1.0
36+
```
37+
38+
最後您也可以直接編譯最新的標籤版本像是 `v1.0.0`,假如您想要從原始碼編譯,這方法是最合適的,在編譯標籤版本前,您需要列出當下所有標籤,並且直接切換到標籤版本,請使用底下指令::
39+
40+
```
41+
git tag -l
42+
git checkout v1.0.0
43+
```
44+
45+
## 編譯
46+
47+
完成設定相依性套件環境等工作後,您就可以開始編譯工作了。我們提供了不同的[編譯選項](https://github.com/go-gitea/gitea/blob/master/Makefile) ,讓編譯過程更加簡單。您可以根據需求來調整編譯選項,底下是可用的編譯選項說明:
48+
49+
* `bindata`: 使用此標籤來嵌入所有 Gitea 相關資源,您不用擔心其他額外檔案,對於部署來說非常方便。
50+
* `sqlite`: 使用此標籤來啟用 [SQLite3](https://sqlite.org/) 資料庫,建議只有少數人時才使用此模式。
51+
* `tidb`: 使用此標籤來啟用 [TiDB](https://github.com/pingcap/tidb) 資料庫,它是檔案形式的資料庫,跟 SQLite 類似。
52+
* `pam`: 使用此標籤來啟用 PAM (Linux Pluggable Authentication Modules) 認證,對於系統使用者來說,此方式最方便了。
53+
54+
現在您可以開始編譯執行檔了,我們建議使用 `bindata` 編譯選項,使用 `bindata` 選項前,您必須執行 `generate` 任務將所有資源都一起編譯進去,否則相關資源都不會被編譯進執行檔:
55+
56+
```
57+
TAGS="bindata" make generate build
58+
```
59+
60+
## 測試
61+
62+
完成上述步驟後,您可以在當下目錄發現 `gitea` 執行檔,在複製執行檔到遠端環境之前,您必須透過底下指令執行測試,使用 `Ctrl + C` 則可以關閉當下 gitea 程序。
63+
64+
```
65+
./gitea web
66+
```
67+
68+
## 需要協助?
69+
70+
如果本頁中無法解決您的問題,請直接到 [Gitter channel](https://gitter.im/go-gitea/gitea/),在那邊可以快速得到協助。
71+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
date: "2016-12-21T15:00:00-02:00"
3+
title: "註冊為 Windows 服務"
4+
slug: "windows-service"
5+
weight: 10
6+
toc: true
7+
draft: false
8+
menu:
9+
sidebar:
10+
parent: "installation"
11+
name: "Windows 服務"
12+
weight: 30
13+
identifier: "windows-service"
14+
---
15+
16+
# 註冊為 Windows 服務
17+
18+
要註冊為 Windows 服務,首先要以管理者身份執行 `cmd`,跳出命令列視窗後執行底下指令:
19+
20+
```
21+
sc create gitea start= auto binPath= ""C:\gitea\gitea.exe" web --config "C:\gitea\custom\conf\app.ini""
22+
```
23+
24+
別忘記將 `C:\gitea` 取代為您的 Gitea 安裝路徑。
25+
26+
之後打開 "Windows Services",並且搜尋服務名稱 "gitea",按右鍵選擇 "Run"。在瀏覽器打開 `http://localhost:3000` 就可以成功看到畫面 (如果修改過連接埠,請自行修正,3000 是預設值)。
27+
28+
## 刪除服務
29+
30+
要刪除 Gitea 服務,請用管理者身份執行 `cmd` 並且執行底下指令:
31+
32+
```
33+
sc remove gitea
34+
```
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
date: "2016-12-01T16:00:00+02:00"
3+
title: "Docker 安裝"
4+
slug: "install-with-docker"
5+
weight: 10
6+
toc: true
7+
draft: false
8+
menu:
9+
sidebar:
10+
parent: "installation"
11+
name: "Docker 安裝"
12+
weight: 10
13+
identifier: "install-with-docker"
14+
---
15+
16+
# 用 Docker 安裝
17+
18+
我們在 Docker Hub 提供了自動更新的映像檔,它會保持最新穩定版。根據您的部屬環境來使用最新版本或用其他服務來更新 Docker 映像檔。首先您需要下載映像檔:
19+
20+
```
21+
docker pull gitea/gitea:latest
22+
```
23+
24+
為了儲存您的所有 Git 儲存庫資料,您應該建立一個目錄,用來存放資料的地方。
25+
26+
```
27+
sudo mkdir -p /var/lib/gitea
28+
```
29+
30+
現在就可以直接啟動 Docker 容器,這是一個非常簡單的過程,您必須定義啟動連接埠,並且提供上面所建立的資料儲存路徑:
31+
32+
```
33+
docker run -d --name=gitea -p 10022:22 -p 10080:3000 -v /var/lib/gitea:/data gitea/gitea:latest
34+
```
35+
36+
然後 Gitea 容器已經開始運行,您可以透過個人喜愛的瀏覽器來訪問 http://hostname:10080,假如您想要開始 Clone 儲存庫,可以直接執行 `git clone ssh://git@hostname:10022/username/repo.git` 指令。
37+
38+
## 需要協助?
39+
40+
如果本頁中無法解決您的問題,請直接到 [Gitter channel](https://gitter.im/go-gitea/gitea/),在那邊可以快速得到協助。

0 commit comments

Comments
 (0)