gitea 手动编译过程,以及踩坑记录
一: 环境介绍
root@server:~# uname -a
Linux server 5.8.0-63-generic #71-Ubuntu SMP Tue Jul 13 15:59:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
root@server:~# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.10
DISTRIB_CODENAME=groovy
DISTRIB_DESCRIPTION="Ubuntu 20.10"
二:下载源码
git clone https://github.com/go-gitea/gitea.git
Cloning into 'gitea'...
remote: Enumerating objects: 177086, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 177086 (delta 0), reused 1 (delta 0), pack-reused 177080
Receiving objects: 100% (177086/177086), 234.97 MiB | 1.50 MiB/s, done.
Resolving deltas: 100% (120466/120466), done.
三:编译安装go 环境
3.1 修改源为阿里
vim sources.list
apt update
3.2 添加执行权限
root@server:/usr/local# cd go/
root@server:/usr/local/go# mkdir GOPATH
chmod -R 0755 go
3.2 添加环境变量
vim ~/.bashrc
export GOROOT=/usr/local/go #GOROOT是系统上安装Go软件包的位置。
export GOPATH=/usr/local/go/GOPATH #GOPATH是工作目录的位置。
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
source ~/.bashrc
go version
四:安装nodejs
4.1 添加源
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
4.2 安装nodejs
sudo apt-get install -y nodejs
查看版本
root@server:/etc/apt# node -v
v14.19.2
apk --no-cache add build-base git nodejs npm
root@server:~/gitea# TAGS=“bindata sqlite sqlite_unlock_notify” make build
./gitea web