shfmt -w globally
This commit is contained in:
parent
4e207414d4
commit
d5f66e4c0a
27 changed files with 378 additions and 375 deletions
|
@ -1,46 +1,46 @@
|
|||
# Copyright 2024 The Forgejo Authors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
FEDERATION_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
FEDERATION_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
export FEDERATION_INSTANCES="ONE TWO"
|
||||
export FEDERATION_CONFIGS
|
||||
|
||||
function federation_setup_variables() {
|
||||
if test "$FEDERATION_CONFIGS" ; then
|
||||
return
|
||||
if test "$FEDERATION_CONFIGS"; then
|
||||
return
|
||||
fi
|
||||
for instance in $FEDERATION_INSTANCES ; do
|
||||
local config=$FEDERATION_DIR/$instance-app.ini
|
||||
FEDERATION_CONFIGS="$FEDERATION_CONFIGS $config"
|
||||
local base=$(work_path_base $config)
|
||||
local work_path=$DIR/$base
|
||||
local host_port=$(get_host_port $config)
|
||||
for instance in $FEDERATION_INSTANCES; do
|
||||
local config=$FEDERATION_DIR/$instance-app.ini
|
||||
FEDERATION_CONFIGS="$FEDERATION_CONFIGS $config"
|
||||
local base=$(work_path_base $config)
|
||||
local work_path=$DIR/$base
|
||||
local host_port=$(get_host_port $config)
|
||||
|
||||
eval export ${instance}_CONFIG=$config
|
||||
eval export ${instance}_CURL=$work_path/forgejo-curl.sh
|
||||
eval export ${instance}_HOST_PORT=$host_port
|
||||
eval export ${instance}_CONFIG=$config
|
||||
eval export ${instance}_CURL=$work_path/forgejo-curl.sh
|
||||
eval export ${instance}_HOST_PORT=$host_port
|
||||
done
|
||||
}
|
||||
|
||||
function federation_verify_scenario() {
|
||||
local scenario=$1
|
||||
local scenario=$1
|
||||
|
||||
export scenario
|
||||
export SCENARIO_DIR=$FEDERATION_DIR/scenario-$scenario
|
||||
export scenario
|
||||
export SCENARIO_DIR=$FEDERATION_DIR/scenario-$scenario
|
||||
|
||||
if test -f $SCENARIO_DIR/setup.sh ; then
|
||||
echo "============================ SETUP scenario-$scenario ==================="
|
||||
bash -ex $SCENARIO_DIR/setup.sh || return 1
|
||||
fi
|
||||
if test -f $SCENARIO_DIR/setup.sh; then
|
||||
echo "============================ SETUP scenario-$scenario ==================="
|
||||
bash -ex $SCENARIO_DIR/setup.sh || return 1
|
||||
fi
|
||||
|
||||
echo "============================ RUN scenario-$scenario ==================="
|
||||
bash -ex $SCENARIO_DIR/run.sh || return 1
|
||||
echo "============================ RUN scenario-$scenario ==================="
|
||||
bash -ex $SCENARIO_DIR/run.sh || return 1
|
||||
|
||||
if test -f $SCENARIO_DIR/teardown.sh ; then
|
||||
echo "============================ TEARDOWN scenario-$scenario ==================="
|
||||
bash -ex $SCENARIO_DIR/teardown.sh || return 1
|
||||
fi
|
||||
if test -f $SCENARIO_DIR/teardown.sh; then
|
||||
echo "============================ TEARDOWN scenario-$scenario ==================="
|
||||
bash -ex $SCENARIO_DIR/teardown.sh || return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function federation_setup() {
|
||||
|
@ -50,9 +50,9 @@ function federation_setup() {
|
|||
federation_teardown
|
||||
|
||||
local config
|
||||
for config in $FEDERATION_CONFIGS ; do
|
||||
reset_forgejo $config
|
||||
start_forgejo $version $config
|
||||
for config in $FEDERATION_CONFIGS; do
|
||||
reset_forgejo $config
|
||||
start_forgejo $version $config
|
||||
done
|
||||
}
|
||||
|
||||
|
@ -60,8 +60,8 @@ function federation_teardown() {
|
|||
federation_setup_variables
|
||||
|
||||
local config
|
||||
for config in $FEDERATION_CONFIGS ; do
|
||||
stop_forgejo $config
|
||||
for config in $FEDERATION_CONFIGS; do
|
||||
stop_forgejo $config
|
||||
done
|
||||
}
|
||||
|
||||
|
@ -71,16 +71,16 @@ function test_federation() {
|
|||
|
||||
local versions="${1:-$RELEASE_NUMBERS_AND_DEV}"
|
||||
|
||||
for version in $versions ; do
|
||||
for version in $versions; do
|
||||
|
||||
if dpkg --compare-versions $version lt 7.1 ; then
|
||||
continue
|
||||
fi
|
||||
if dpkg --compare-versions $version lt 7.1; then
|
||||
continue
|
||||
fi
|
||||
|
||||
federation_setup $version
|
||||
federation_setup $version
|
||||
|
||||
for scenario in star ; do
|
||||
run federation_verify_scenario $scenario
|
||||
done
|
||||
for scenario in star; do
|
||||
run federation_verify_scenario $scenario
|
||||
done
|
||||
done
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue