Gitea-ui-customized : update to be compatible with Gitea 1.18

build_gitea : Support git tag and build a completely usable binary
This commit is contained in:
unknown 2023-01-11 20:10:08 +07:00
parent 8f9d3289f9
commit 045603d65e
Signed by: minoplhy
GPG Key ID: 90667A59A9908AEC
2 changed files with 65 additions and 44 deletions

File diff suppressed because it is too large Load Diff

View File

@ -4,9 +4,11 @@ DESTINATION=~/gitea-binaries/
mkdir -p $DESTINATION mkdir -p $DESTINATION
cd $MAKE_DIR cd $MAKE_DIR
GIT_TAG=$1
# NodeJS # NodeJS
VERSION=v19.2.0 VERSION=v19.4.0
DISTRO=linux-x64 DISTRO=linux-x64
wget https://nodejs.org/dist/$VERSION/node-$VERSION-$DISTRO.tar.xz wget https://nodejs.org/dist/$VERSION/node-$VERSION-$DISTRO.tar.xz
@ -17,7 +19,7 @@ export PATH=/usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin:$PATH
# Golang # Golang
GO_VERSION=1.19.3 GO_VERSION=1.19.5
sudo unlink /usr/bin/go sudo unlink /usr/bin/go
wget https://go.dev/dl/go$GO_VERSION.linux-amd64.tar.gz wget https://go.dev/dl/go$GO_VERSION.linux-amd64.tar.gz
@ -31,10 +33,26 @@ sudo apt-get update && sudo apt-get install make
# Gitea # Gitea
git clone --depth=1 https://github.com/go-gitea/gitea # GIT_TAG=
# specify the tag which gitea will build on
git clone https://github.com/go-gitea/gitea
cd gitea cd gitea
LDFLAGS="-X \"code.gitea.io/gitea/modules/setting.AppWorkPath=/var/lib/gitea/\" -X \"code.gitea.io/gitea/modules/setting.CustomConf=/etc/gitea/app.ini\"" GOOS=linux GOARCH=amd64 make build
if [[ -n $GIT_TAG ]]
then
if git show-ref $GIT_TAG --quiet; then
git checkout $GIT_TAG
else
echo "Variable GIT_TAG doesn't existed in the repo. fallback to default"
fi
else
echo "GIT_TAG variable doesn't exist skipping"
fi
LDFLAGS="-X \"code.gitea.io/gitea/modules/setting.AppWorkPath=/var/lib/gitea/\" -X \"code.gitea.io/gitea/modules/setting.CustomConf=/etc/gitea/app.ini\"" TAGS="bindata sqlite sqlite_unlock_notify" GOOS=linux GOARCH=amd64 make build
mv gitea $DESTINATION/gitea mv gitea $DESTINATION/gitea
# Cleanup # Cleanup
rm -rf $MAKE_DIR rm -rf $MAKE_DIR