Gitea:修订间差异
跳到导航
跳到搜索
此页面具有访问限制。如果您看见此消息,则说明您没有权限访问此页面。
(→安裝) |
(→外部連結) 标签:手工回退 |
||
(未显示同一用户的9个中间版本) | |||
第3行: | 第3行: | ||
== 安裝 == | == 安裝 == | ||
這邊的安裝是假設在[[Ubuntu]] 22.04下 | 這邊的安裝是假設在[[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> | |||
接著 先建立使用者帳號: | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
第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