「Gitea」:修訂間差異
跳至導覽
跳至搜尋
標籤:手動回退 |
|||
(未顯示同一使用者於中間所作的 8 次修訂) | |||
第3行: | 第3行: | ||
== 安裝 == | == 安裝 == | ||
這邊的安裝是假設在[[Ubuntu]] 22.04下,請先安裝[[MySQL]],後 | 這邊的安裝是假設在[[Ubuntu]] 22.04下,請先安裝[[MySQL]],然後建立對應的資料庫相關權限: | ||
<syntaxhighlight lang="sql"> | |||
CREATE DATABASE giteadb CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_bin'; | |||
CREATE USER 'gitea'@'%' IDENTIFIED BY 'password'; | |||
GRANT ALL PRIVILEGES ON giteadb.* TO 'gitea'@'%'; | |||
</syntaxhighlight> | |||
接著先建立使用者帳號: | 接著先建立使用者帳號: | ||
第27行: | 第33行: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
cd /etc/systemd/system; sudo wget -c https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/systemd/gitea.service; sudo systemctl daemon-reload; sudo systemctl enable --now gitea | cd /etc/systemd/system; sudo wget -c https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/systemd/gitea.service; sudo systemctl daemon-reload; sudo systemctl enable --now gitea | ||
</syntaxhighlight> | |||
預設會跑在機器的127.0.0.1:3000上。 | |||
=== act_runner === | |||
act_runner是Gitea的CI工具,目前還在alpha版: | |||
<syntaxhighlight lang="bash"> | |||
GITEA_ACT_RUNNER_VER=0.2.6; sudo mkdir -p /usr/local/bin; cd /usr/local/bin; sudo wget -c https://gitea.com/gitea/act_runner/releases/download/v${GITEA_ACT_RUNNER_VER}/act_runner-${GITEA_ACT_RUNNER_VER}-linux-amd64; sudo chmod 755 act_runner-${GITEA_ACT_RUNNER_VER}-linux-amd64; sudo ln -sf act_runner-${GITEA_ACT_RUNNER_VER}-linux-amd64 act_runner | |||
</syntaxhighlight> | </syntaxhighlight> | ||
第32行: | 第48行: | ||
* {{Official|https://about.gitea.com/}} {{en}} | * {{Official|https://about.gitea.com/}} {{en}} | ||
* {{Official|https://gitea.com/gitea/act_runner}} {{en}} | |||
[[Category:軟體]] | [[Category:軟體]] |
於 2024年2月26日 (一) 21:11 的最新修訂
Gitea一套輕量級的Git託管軟體。
安裝
這邊的安裝是假設在Ubuntu 22.04下,請先安裝MySQL,然後建立對應的資料庫相關權限:
CREATE DATABASE giteadb CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_bin';
CREATE USER 'gitea'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON giteadb.* TO 'gitea'@'%';
接著先建立使用者帳號:
sudo adduser --system --shell /bin/bash --gecos 'Git Version Control' --group --disabled-password --home /home/git git
再來建立對應的目錄結構(這邊的/etc/gitea
設為770
是暫時性的,後續等Gitea把設定檔寫進去後就會修正):
sudo mkdir -p /var/lib/gitea/{custom,data,log}; sudo chown -R git:git /var/lib/gitea; sudo chmod -R 750 /var/lib/gitea; sudo mkdir /etc/gitea; sudo chown root:git /etc/gitea; sudo chmod 770 /etc/gitea
接著下載軟體檔案:
GITEA_VER=1.21.7; sudo mkdir -p /usr/local/bin; cd /usr/local/bin; sudo wget -c https://github.com/go-gitea/gitea/releases/download/v${GITEA_VER}/gitea-${GITEA_VER}-linux-amd64; sudo chmod 755 gitea-${GITEA_VER}-linux-amd64; sudo ln -sf gitea-${GITEA_VER}-linux-amd64 gitea
然後是systemd的設定檔:
cd /etc/systemd/system; sudo wget -c https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/systemd/gitea.service; sudo systemctl daemon-reload; sudo systemctl enable --now gitea
預設會跑在機器的127.0.0.1:3000上。
act_runner
act_runner是Gitea的CI工具,目前還在alpha版:
GITEA_ACT_RUNNER_VER=0.2.6; sudo mkdir -p /usr/local/bin; cd /usr/local/bin; sudo wget -c https://gitea.com/gitea/act_runner/releases/download/v${GITEA_ACT_RUNNER_VER}/act_runner-${GITEA_ACT_RUNNER_VER}-linux-amd64; sudo chmod 755 act_runner-${GITEA_ACT_RUNNER_VER}-linux-amd64; sudo ln -sf act_runner-${GITEA_ACT_RUNNER_VER}-linux-amd64 act_runner