lib: add $work_path/forgejo-curl.sh for each Forgejo instance
The $work_path/forgejo-curl.sh for each Forgejo instance is logged in with admin permissions and ready to use. The default forgejo-curl.sh remains logged in the last Forgejo instance that was launched.
This commit is contained in:
parent
078107026b
commit
19ce0fe6b1
1 changed files with 12 additions and 2 deletions
14
lib/lib.sh
14
lib/lib.sh
|
@ -35,7 +35,7 @@ export DOT_FORGEJO_CURL=$DIR/forgejo-curl
|
|||
export DOT=$DOT_FORGEJO_CURL # for backward compatibility with forgejo-curl.sh 1.0.0
|
||||
: ${FORGEJO_USER:=root}
|
||||
: ${FORGEJO_PASSWORD:=admin1234}
|
||||
RELEASE_NUMBERS_AND_DEV="$(for r in $RELEASE_NUMBERS ; do echo -n "$r $r-dev " ; done)"
|
||||
: ${RELEASE_NUMBERS_AND_DEV:="$(for r in $RELEASE_NUMBERS ; do echo -n "$r $r-dev " ; done)"}
|
||||
ORGANIZATIONS=$(cat $LIB_DIR/ORGANIZATIONS)
|
||||
|
||||
function log_info() {
|
||||
|
@ -312,7 +312,17 @@ function create_user_and_login() {
|
|||
if echo $version | grep --quiet 1.18 ; then
|
||||
scopes=""
|
||||
fi
|
||||
forgejo-curl.sh --user "$FORGEJO_USER" --password "$FORGEJO_PASSWORD" $scopes login http://${HOST_PORT}
|
||||
forgejo-curl.sh --user "$FORGEJO_USER" --password "$FORGEJO_PASSWORD" $scopes login http://$(get_host_port $config)
|
||||
|
||||
local forgejo_curl=$work_path/forgejo-curl.sh
|
||||
cat > $forgejo_curl <<EOF
|
||||
#!/bin/bash
|
||||
export DOT_FORGEJO_CURL=$work_path/forgejo-curl
|
||||
export DOT=$work_path/forgejo-curl # for backward compatibility with forgejo-curl.sh 1.0.0
|
||||
forgejo-curl.sh "\$@"
|
||||
EOF
|
||||
chmod +x $forgejo_curl
|
||||
cp -a $DOT_FORGEJO_CURL $work_path/forgejo-curl
|
||||
}
|
||||
|
||||
function stop_daemon() {
|
||||
|
|
Loading…
Add table
Reference in a new issue