merge actions test into end-to-end.sh
* replace the high level test running actions tests with end-to-end.sh * set DOMAIN to the IP instead of 127.0.0.1 for runner <-> forgejo communications * move forgejo_cli from a function to a file so that it can be used by forgejo-runner.sh * keep the documentation updates workflows separate because they need to open one PR per version
This commit is contained in:
parent
5bb5e037ce
commit
96f91063c9
21 changed files with 235 additions and 269 deletions
26
lib/lib.sh
26
lib/lib.sh
|
@ -28,7 +28,7 @@ RELEASE_NUMBERS="7.0"
|
|||
|
||||
PREFIX===============
|
||||
HOST_PORT=$IP:3000
|
||||
DIR=/tmp/forgejo-end-to-end
|
||||
export DIR=/tmp/forgejo-end-to-end
|
||||
DIR_BINARIES=/srv/forgejo-binaries
|
||||
export DOT_FORGEJO_CURL=$DIR/forgejo-curl
|
||||
export DOT=$DOT_FORGEJO_CURL # for backward compatibility with forgejo-curl.sh 1.0.0
|
||||
|
@ -47,9 +47,9 @@ function dependencies() {
|
|||
$SUDO chmod +x /usr/local/bin/forgejo-curl.sh
|
||||
fi
|
||||
|
||||
if ! which curl daemon jq git-lfs > /dev/null ; then
|
||||
if ! which make curl daemon git-lfs jq sqlite3 > /dev/null ; then
|
||||
$SUDO apt-get update -qq
|
||||
$SUDO apt-get install -y -qq curl daemon git-lfs jq sqlite3 gettext-base
|
||||
$SUDO apt-get install -y -qq make curl daemon git-lfs jq sqlite3 gettext-base
|
||||
fi
|
||||
|
||||
if ! test -f /usr/local/bin/mc || ! test -f /usr/local/bin/minio ; then
|
||||
|
@ -159,6 +159,8 @@ function start_forgejo() {
|
|||
grep '' $work_path/log/*.log 2> /dev/null
|
||||
return 1
|
||||
fi
|
||||
echo "$DIR_BINARIES/forgejo-$version --config $work_path/app.ini --work-path $work_path" '"$@"' > $DIR/forgejocli
|
||||
chmod +x $DIR/forgejocli
|
||||
create_user_and_login $version
|
||||
}
|
||||
|
||||
|
@ -238,7 +240,7 @@ function reset_forgejo() {
|
|||
local work_path=$DIR/forgejo-work-path
|
||||
rm -fr $work_path
|
||||
mkdir -p $work_path
|
||||
WORK_PATH=$work_path envsubst < $config > $work_path/app.ini
|
||||
IP=$IP WORK_PATH=$work_path envsubst < $config > $work_path/app.ini
|
||||
}
|
||||
|
||||
function reset_minio() {
|
||||
|
@ -249,20 +251,12 @@ function reset_garage() {
|
|||
rm -fr $DIR/garage
|
||||
}
|
||||
|
||||
function forgejo_cli() {
|
||||
local version="$1"
|
||||
shift
|
||||
local work_path=$DIR/forgejo-work-path
|
||||
|
||||
$DIR_BINARIES/forgejo-$version --config $work_path/app.ini --work-path $work_path "$@"
|
||||
}
|
||||
|
||||
function create_user_and_login() {
|
||||
local version=$1
|
||||
|
||||
local email="$FORGEJO_USER@example.com"
|
||||
if ! forgejo_cli $version admin user list | grep --quiet "$email" ; then
|
||||
forgejo_cli $version admin user create --admin --username "$FORGEJO_USER" --password "$FORGEJO_PASSWORD" --email $email
|
||||
if ! $DIR/forgejocli admin user list | grep --quiet "$email" ; then
|
||||
$DIR/forgejocli admin user create --admin --username "$FORGEJO_USER" --password "$FORGEJO_PASSWORD" --email $email
|
||||
fi
|
||||
|
||||
forgejo-curl.sh logout
|
||||
|
@ -302,10 +296,10 @@ function run() {
|
|||
local fun=$1
|
||||
shift
|
||||
|
||||
echo Start running $fun
|
||||
echo Start running $fun "$@"
|
||||
mkdir -p $DIR
|
||||
> $DIR/$fun.out
|
||||
tail --follow $DIR/$fun.out | sed --unbuffered -n -e "/^$PREFIX/s/^$PREFIX //p" &
|
||||
tail --follow $DIR/$fun.out |& sed --unbuffered -n -e "/^$PREFIX/s/^$PREFIX //p" &
|
||||
local pid=$!
|
||||
if ! VERBOSE=true $SELF $fun "$@" >& $DIR/$fun.out ; then
|
||||
kill $pid
|
||||
|
|
Loading…
Add table
Reference in a new issue