build_gitea : I'm tired of doing a version number bump every few months
This commit is contained in:
parent
dd2b86a42d
commit
303c251b10
@ -6,27 +6,42 @@ DESTINATION=~/gitea-binaries/
|
||||
mkdir -p $DESTINATION
|
||||
cd $MAKE_DIR
|
||||
|
||||
GIT_TAG=$1
|
||||
while getopts 'v:g:n:' flag
|
||||
do
|
||||
case "${flag}" in
|
||||
v) GITEA_GIT_TAG=${OPTARG};; # Gitea Git Tag
|
||||
g) GO_VERSION=${OPTARG};; # GOLANG Version
|
||||
n) NODEJS_VERSION=${OPTARG};; # NodeJS Version
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
if [[ -n $NODEJS_VERSION ]]
|
||||
then
|
||||
NODEJS_VERSION=v20.3.1
|
||||
fi
|
||||
|
||||
if [[ -n $GO_VERSION ]]
|
||||
then
|
||||
GO_VERSION=1.20.5
|
||||
fi
|
||||
|
||||
# GITEA_GIT_TAG is being process below
|
||||
|
||||
# Install Dependencies
|
||||
|
||||
sudo apt-get update && sudo apt-get install xz-utils wget git tar g++ make -y
|
||||
|
||||
# NodeJS
|
||||
|
||||
VERSION=v20.3.1
|
||||
DISTRO=linux-x64
|
||||
|
||||
wget https://nodejs.org/dist/$VERSION/node-$VERSION-$DISTRO.tar.xz
|
||||
wget https://nodejs.org/dist/$NODEJS_VERSION/node-$NODEJS_VERSION-$DISTRO.tar.xz
|
||||
sudo mkdir -p /usr/local/lib/nodejs
|
||||
sudo tar -xJvf node-$VERSION-$DISTRO.tar.xz -C /usr/local/lib/nodejs
|
||||
export PATH=/usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin:$PATH
|
||||
sudo tar -xJvf node-$NODEJS_VERSION-$DISTRO.tar.xz -C /usr/local/lib/nodejs
|
||||
export PATH=/usr/local/lib/nodejs/node-$NODEJS_VERSION-$DISTRO/bin:$PATH
|
||||
. ~/.profile
|
||||
|
||||
# Golang
|
||||
|
||||
GO_VERSION=1.20.5
|
||||
|
||||
sudo unlink /usr/bin/go
|
||||
wget https://go.dev/dl/go$GO_VERSION.linux-amd64.tar.gz
|
||||
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go$GO_VERSION.linux-amd64.tar.gz
|
||||
@ -41,10 +56,10 @@ sudo ln -s /usr/local/go/bin /usr/bin/go
|
||||
git clone https://github.com/go-gitea/gitea
|
||||
cd gitea
|
||||
|
||||
if [[ -n $GIT_TAG ]]
|
||||
if [[ -n $GITEA_GIT_TAG ]]
|
||||
then
|
||||
if git show-ref $GIT_TAG --quiet; then
|
||||
git checkout $GIT_TAG
|
||||
if git show-ref $GITEA_GIT_TAG --quiet; then
|
||||
git checkout $GITEA_GIT_TAG
|
||||
else
|
||||
echo -e "\nGIT_TAG variable doesn't match the repo tag/version. exit to prevent further issue." && exit 1 && rm -rf $MAKE_DIR
|
||||
fi
|
||||
|
@ -7,7 +7,15 @@ curl -L https://github.com/minoplhy/scriptbox/raw/main/build_gitea/Linux/build.s
|
||||
or with a git tag
|
||||
|
||||
```shell
|
||||
curl -L https://github.com/minoplhy/scriptbox/raw/main/build_gitea/Linux/build.sh | bash -s -- "v1.18.0"
|
||||
curl -L https://github.com/minoplhy/scriptbox/raw/main/build_gitea/Linux/build.sh | bash -s -- -v "v1.18.0"
|
||||
```
|
||||
|
||||
# Arguments
|
||||
|
||||
```
|
||||
v) GITEA_GIT_TAG=${OPTARG};; # Gitea Git Tag
|
||||
g) GO_VERSION=${OPTARG};; # GOLANG Version
|
||||
n) NODEJS_VERSION=${OPTARG};; # NodeJS Version
|
||||
```
|
||||
|
||||
# Known Issues
|
||||
|
Loading…
Reference in New Issue
Block a user