flow updates
This commit is contained in:
19
flow
19
flow
@ -10,21 +10,6 @@ BUILD_DIRECTORY="web"
|
|||||||
GITEA_ORGANIZATION="agreego"
|
GITEA_ORGANIZATION="agreego"
|
||||||
GITEA_REPOSITORY="site"
|
GITEA_REPOSITORY="site"
|
||||||
|
|
||||||
env() {
|
|
||||||
# Check if GITEA_TOKEN is set
|
|
||||||
if [ -z "$GITEA_TOKEN" ]; then
|
|
||||||
# If not set, try to get it from kubectl
|
|
||||||
GITEA_TOKEN=$(kubectl get secret -n cellular gitea-git -o jsonpath='{.data.token}' | base64 --decode)
|
|
||||||
if [ -z "$GITEA_TOKEN" ]; then
|
|
||||||
error "GITEA_TOKEN is not set and couldn't be retrieved from kubectl" >&2
|
|
||||||
return 2 # Handled error
|
|
||||||
fi
|
|
||||||
export GITEA_TOKEN
|
|
||||||
fi
|
|
||||||
|
|
||||||
success "Environment variables set"
|
|
||||||
}
|
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
# Create build directory if it doesn't exist
|
# Create build directory if it doesn't exist
|
||||||
mkdir -p "$PACKAGE_DIRECTORY"
|
mkdir -p "$PACKAGE_DIRECTORY"
|
||||||
@ -38,17 +23,15 @@ build() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
site-usage() {
|
site-usage() {
|
||||||
printf "env\tLoad environment variables from .env file.\n"
|
|
||||||
printf "build\tBuild the site.\n"
|
printf "build\tBuild the site.\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
site-flow() {
|
site-flow() {
|
||||||
case "$1" in
|
case "$1" in
|
||||||
env) env; return $?;;
|
|
||||||
build) build; return $?;;
|
build) build; return $?;;
|
||||||
*) return 1 ;;
|
*) return 1 ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
register-flow "site-flow" "site-usage"
|
register-flow "site-usage" "site-flow"
|
||||||
dispatch "$@"
|
dispatch "$@"
|
||||||
2
flows
2
flows
Submodule flows updated: c33e7e1e05...e154758056
Reference in New Issue
Block a user