init repo

This commit is contained in:
2024-11-18 01:04:43 +01:00
commit f039652d4b
16 changed files with 552 additions and 0 deletions

58
do Executable file
View File

@ -0,0 +1,58 @@
#!/bin/bash
set -euo pipefail
script_dir="$(cd "$(dirname "${0}")"; pwd -P)"
app_name='permission-manager'
postgres_image="postgres:16-alpine"
postgres_port=16060
postgres_container_name="pmg-db"
go_junit_report_version='latest'
gocov_version='latest'
gocov_xml_version='latest'
linter_version='v1.62.0'
swag_version='v1.16.3'
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