mirror of
https://github.com/minoplhy/scriptbox.git
synced 2025-05-17 09:40:21 +00:00
build_gitea: support custom source folder
This commit is contained in:
parent
8f7be21ee8
commit
6efab71c33
@ -40,6 +40,17 @@ while [ ${#} -gt 0 ]; do
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
--source-folder=* )
|
||||||
|
SOURCE_FOLDER="${1#*=}"
|
||||||
|
case $SOURCE_FOLDER in
|
||||||
|
"")
|
||||||
|
echo "ERROR: --source-folder= is empty!"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;; # Source folder for your gitea/forgejo build / in case --type does not satisfy you
|
||||||
--patch=* )
|
--patch=* )
|
||||||
PATCH_FILES="${1#*=}"
|
PATCH_FILES="${1#*=}"
|
||||||
case $PATCH_FILES in
|
case $PATCH_FILES in
|
||||||
@ -75,7 +86,17 @@ done
|
|||||||
# If empty
|
# If empty
|
||||||
NODEJS_VERSION=${NODEJS_VERSION:-"v20.17.0"}
|
NODEJS_VERSION=${NODEJS_VERSION:-"v20.17.0"}
|
||||||
GO_VERSION=${GO_VERSION:-"1.23.2"}
|
GO_VERSION=${GO_VERSION:-"1.23.2"}
|
||||||
|
|
||||||
|
# Source folder get more priority than the --type
|
||||||
|
if [[ -z $SOURCE_FOLDER ]]; then
|
||||||
BUILD_TYPE=${BUILD_TYPE:-"gitea"}
|
BUILD_TYPE=${BUILD_TYPE:-"gitea"}
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n $SOURCE_FOLDER && ! -d $SOURCE_FOLDER ]]; then
|
||||||
|
printf "Error: folder '%s' not exist! exiting...\n" $SOURCE_FOLDER
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
DESTINATION=${DESTINATION:-"~/gitea-binaries"}
|
DESTINATION=${DESTINATION:-"~/gitea-binaries"}
|
||||||
|
|
||||||
# Clean up old build
|
# Clean up old build
|
||||||
@ -177,7 +198,7 @@ fi
|
|||||||
|
|
||||||
# GIT_TAG=
|
# GIT_TAG=
|
||||||
# specify the tag which gitea will build on
|
# specify the tag which gitea will build on
|
||||||
|
if [[ -z $SOURCE_FOLDER ]]; then
|
||||||
case $BUILD_TYPE in
|
case $BUILD_TYPE in
|
||||||
"gitea")
|
"gitea")
|
||||||
echo "INFO: Building on gitea"
|
echo "INFO: Building on gitea"
|
||||||
@ -188,6 +209,11 @@ case $BUILD_TYPE in
|
|||||||
git clone https://codeberg.org/forgejo/forgejo $DESTINATION/gitea-repo #LOL
|
git clone https://codeberg.org/forgejo/forgejo $DESTINATION/gitea-repo #LOL
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
else
|
||||||
|
echo "INFO: Building on custom source"
|
||||||
|
echo "INFO: Copying source from original folder"
|
||||||
|
cp -r $SOURCE_FOLDER $DESTINATION/gitea-repo
|
||||||
|
fi
|
||||||
|
|
||||||
cd $DESTINATION/gitea-repo
|
cd $DESTINATION/gitea-repo
|
||||||
|
|
||||||
|
@ -53,6 +53,17 @@ while [ ${#} -gt 0 ]; do
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
--source-folder=* )
|
||||||
|
SOURCE_FOLDER="${1#*=}"
|
||||||
|
case $SOURCE_FOLDER in
|
||||||
|
"")
|
||||||
|
echo "ERROR: --source-folder= is empty!"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;; # Source folder for your gitea/forgejo build / in case --type does not satisfy you
|
||||||
--patch=* )
|
--patch=* )
|
||||||
PATCH_FILES="${1#*=}"
|
PATCH_FILES="${1#*=}"
|
||||||
case $PATCH_FILES in
|
case $PATCH_FILES in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user