46 lines
880 B
Bash
Executable File
46 lines
880 B
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
script_dir="$(cd "$(dirname "${0}")"; pwd -P)"
|
|
|
|
grey='\033[0;37m'
|
|
red='\033[1;31m'
|
|
green='\033[1;32m'
|
|
cyan='\033[1;36m'
|
|
yellow='\033[1;33m'
|
|
normal='\033[0m'
|
|
|
|
function log {
|
|
echo -e "$@"
|
|
}
|
|
|
|
|
|
## full-release : creates and publishes a new release to maven central
|
|
function task_full_release() {
|
|
gitea_token="$(cat "${script_dir}/.gitea-token")"
|
|
|
|
task_build
|
|
mvn jreleaser:full-release -Dgitea.token="$gitea_token"
|
|
}
|
|
|
|
|
|
## build : builds the application and stages files
|
|
function task_build() {
|
|
mvn clean
|
|
mvn -Pstage
|
|
}
|
|
|
|
function task_usage {
|
|
echo "Usage: $0"
|
|
sed -n 's/^##//p' <$0 | column -t -s ':' | sed -E $'s/^/\t/' | sort
|
|
}
|
|
|
|
cmd=${1:-}
|
|
shift || true
|
|
resolved_command=$(echo "task_${cmd}" | sed 's/-/_/g')
|
|
if [[ "$(LC_ALL=C type -t "${resolved_command}")" == "function" ]]; then
|
|
${resolved_command} "$@"
|
|
else
|
|
task_usage
|
|
exit 1
|
|
fi
|