2022-12-02 13:52:57 +00:00
|
|
|
# Build Gitea
|
|
|
|
It's simple, Build Gitea and done. nothing special.
|
|
|
|
|
|
|
|
```shell
|
2022-12-02 14:08:30 +00:00
|
|
|
curl -L https://github.com/minoplhy/scriptbox/raw/main/build_gitea/Linux/build.sh | bash
|
2022-12-02 14:13:51 +00:00
|
|
|
```
|
2023-01-11 13:22:23 +00:00
|
|
|
or with a git tag
|
|
|
|
|
|
|
|
```shell
|
2023-11-21 12:43:59 +00:00
|
|
|
curl -L https://github.com/minoplhy/scriptbox/raw/main/build_gitea/Linux/build.sh | bash -s -- -v "v1.18.0"
|
|
|
|
```
|
|
|
|
|
|
|
|
# Arguments
|
|
|
|
|
2023-11-21 12:54:01 +00:00
|
|
|
```bash
|
2024-04-27 15:38:20 +00:00
|
|
|
while [ ${#} -gt 0 ]; do
|
|
|
|
case "$1" in
|
2024-10-28 05:04:16 +00:00
|
|
|
--git-tag | -v)
|
2024-04-27 15:38:20 +00:00
|
|
|
shift
|
|
|
|
GITEA_GIT_TAG=$1
|
|
|
|
;; # Gitea Git Tag
|
2024-10-28 05:04:16 +00:00
|
|
|
--golang-version | -g)
|
2024-04-27 15:38:20 +00:00
|
|
|
shift
|
2024-10-28 05:04:16 +00:00
|
|
|
GO_VERSION=$1
|
2024-04-27 15:38:20 +00:00
|
|
|
;; # GOLANG Version
|
2024-10-28 05:04:16 +00:00
|
|
|
--nodejs-version | -n)
|
2024-04-27 15:38:20 +00:00
|
|
|
shift
|
2024-10-28 05:04:16 +00:00
|
|
|
NODEJS_VERSION=$1
|
2024-04-27 15:38:20 +00:00
|
|
|
;; # NodeJS Version
|
2024-10-28 05:04:16 +00:00
|
|
|
--static | -s)
|
|
|
|
BUILD_STATIC=true
|
2024-10-02 17:08:18 +00:00
|
|
|
;; # Also Build Static Assets file
|
|
|
|
--type=* )
|
|
|
|
BUILD_TYPE="${1#*=}"
|
|
|
|
BUILD_TYPE="${BUILD_TYPE,,}"
|
|
|
|
case $BUILD_TYPE in
|
|
|
|
"gitea") BUILD_TYPE="gitea" ;;
|
2024-10-28 05:04:16 +00:00
|
|
|
"forgejo") BUILD_TYPE="forgejo" ;;
|
2024-10-02 17:08:18 +00:00
|
|
|
"")
|
|
|
|
echo "ERROR : --type= is empty!"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "ERROR : Vaild values for --type are -> gitea, forgejo"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
2024-10-28 05:04:16 +00:00
|
|
|
--patch=* )
|
|
|
|
PATCH_FILES="${1#*=}"
|
|
|
|
case $PATCH_FILES in
|
|
|
|
"")
|
|
|
|
echo "ERROR: --patch= is empty!"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
2024-10-30 13:08:41 +00:00
|
|
|
;; # Add Patches to your Gitea build. Format -> patch1.patch or patch1.patch,https://patch (Absolute path)
|
2024-04-27 15:38:20 +00:00
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift # Shift to next response for parsing
|
|
|
|
done
|
2023-01-11 13:22:23 +00:00
|
|
|
```
|
2022-12-02 14:13:51 +00:00
|
|
|
|
|
|
|
# Known Issues
|
|
|
|
|
2023-01-13 16:23:11 +00:00
|
|
|
- This script required root privileges because of dependencies installation, which is hard to avoid.
|