2023-10-11 15:39:52 +02:00
|
|
|
#!/bin/bash
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
SELF_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
2023-10-11 18:05:11 +02:00
|
|
|
source $SELF_DIR/../cascading-pr-lib.sh
|
2023-10-11 15:39:52 +02:00
|
|
|
|
|
|
|
function push_self() {
|
|
|
|
local host_port=$1
|
|
|
|
|
|
|
|
forgejo-test-helper.sh push_self_action http://root:admin1234@$host_port root cascading-pr vTest
|
|
|
|
}
|
|
|
|
|
|
|
|
function run() {
|
2023-10-11 18:05:11 +02:00
|
|
|
push_self ${options[host_port]}
|
2023-10-11 15:39:52 +02:00
|
|
|
|
|
|
|
echo do something
|
|
|
|
}
|
|
|
|
|
|
|
|
function main() {
|
|
|
|
local command=run
|
2023-10-11 18:05:11 +02:00
|
|
|
options[host_port]=$(cat forgejo-ip):3000
|
|
|
|
options[url]=http://$host_port
|
|
|
|
options[token]=$(cat forgejo-token)
|
2023-10-11 15:39:52 +02:00
|
|
|
|
|
|
|
while true; do
|
|
|
|
case "$1" in
|
|
|
|
--verbose)
|
|
|
|
shift
|
|
|
|
verbose
|
|
|
|
;;
|
|
|
|
--debug)
|
|
|
|
shift
|
|
|
|
debug
|
|
|
|
;;
|
2023-10-11 15:50:12 +02:00
|
|
|
--host_port)
|
|
|
|
shift
|
2023-10-11 18:05:11 +02:00
|
|
|
options[host_port]=$1
|
2023-10-11 15:50:12 +02:00
|
|
|
;;
|
|
|
|
--url)
|
|
|
|
shift
|
2023-10-11 18:05:11 +02:00
|
|
|
options[url]=$1
|
2023-10-11 15:50:12 +02:00
|
|
|
;;
|
|
|
|
--token)
|
|
|
|
shift
|
2023-10-11 18:05:11 +02:00
|
|
|
options[token]=$1
|
2023-10-11 15:50:12 +02:00
|
|
|
;;
|
2023-10-11 15:39:52 +02:00
|
|
|
*)
|
2023-10-11 18:05:11 +02:00
|
|
|
"${1:-run}"
|
2023-10-11 15:39:52 +02:00
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
${MAIN:-main} "${@}"
|