Skip to content

Commit

Permalink
Merge pull request #13598 from nextcloud/backport/13581/stable30.0
Browse files Browse the repository at this point in the history
[stable30.0] ci: Fix restoring the domain and skeleton of the main and real-fed se…
  • Loading branch information
nickvergessen authored Oct 22, 2024
2 parents e8a46ce + 1225e9c commit db844cd
Showing 1 changed file with 32 additions and 20 deletions.
52 changes: 32 additions & 20 deletions tests/integration/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,22 +89,22 @@ export MAIN_SERVER_CONFIG_DIR
export REAL_FEDERATED_SERVER_CONFIG_DIR

export NEXTCLOUD_CONFIG_DIR="$MAIN_SERVER_CONFIG_DIR"
OVERWRITE_CLI_URL=$(${ROOT_DIR}/occ config:system:get overwrite.cli.url)
MAIN_OVERWRITE_CLI_URL=$(${ROOT_DIR}/occ config:system:get overwrite.cli.url)
MAIN_SKELETON_DIR=$(${ROOT_DIR}/occ config:system:get skeletondirectory)
${ROOT_DIR}/occ config:system:set overwrite.cli.url --value "http://localhost:8080/"
if [[ "$MAIN_SKELETON_DIR" != "" ]]; then
echo "Resetting custom skeletondirectory so that tests pass"
${ROOT_DIR}/occ config:system:delete skeletondirectory
fi

export NEXTCLOUD_CONFIG_DIR="$REAL_FEDERATED_SERVER_CONFIG_DIR"
OVERWRITE_CLI_URL=$(${ROOT_DIR}/occ config:system:get overwrite.cli.url)
REAL_FEDERATED_OVERWRITE_CLI_URL=$(${ROOT_DIR}/occ config:system:get overwrite.cli.url)
REAL_FEDERATED_SKELETON_DIR=$(${ROOT_DIR}/occ config:system:get skeletondirectory)
${ROOT_DIR}/occ config:system:set overwrite.cli.url --value "$TEST_REMOTE_URL"

for CONFIG_DIR in $MAIN_SERVER_CONFIG_DIR $REAL_FEDERATED_SERVER_CONFIG_DIR; do
export NEXTCLOUD_CONFIG_DIR="$CONFIG_DIR"

SKELETON_DIR=$(${ROOT_DIR}/occ config:system:get skeletondirectory)
if [[ "$SKELETON_DIR" ]]; then
echo "Resetting custom skeletondirectory so that tests pass"
${ROOT_DIR}/occ config:system:delete skeletondirectory
fi
done
if [[ "$REAL_FEDERATED_SKELETON_DIR" != "" ]]; then
echo "Resetting custom skeletondirectory so that tests pass"
${ROOT_DIR}/occ config:system:delete skeletondirectory
fi

echo ''
echo -e "\033[0;36m#\033[0m"
Expand Down Expand Up @@ -193,18 +193,25 @@ echo ''
echo -e "\033[0;36m#\033[0m"
echo -e "\033[0;36m# Reverting configuration changes and disabling spreedcheats\033[0m"
echo -e "\033[0;36m#\033[0m"
for CONFIG_DIR in $MAIN_SERVER_CONFIG_DIR $REAL_FEDERATED_SERVER_CONFIG_DIR; do
export NEXTCLOUD_CONFIG_DIR="$CONFIG_DIR"

${ROOT_DIR}/occ app:disable spreedcheats
${ROOT_DIR}/occ config:system:set overwrite.cli.url --value $OVERWRITE_CLI_URL
if [[ "$SKELETON_DIR" ]]; then
${ROOT_DIR}/occ config:system:set skeletondirectory --value "$SKELETON_DIR"
fi
done
# Main server
export NEXTCLOUD_CONFIG_DIR="$MAIN_SERVER_CONFIG_DIR"
${ROOT_DIR}/occ app:disable spreedcheats
${ROOT_DIR}/occ config:system:set overwrite.cli.url --value "$MAIN_OVERWRITE_CLI_URL"
if [[ "$MAIN_SKELETON_DIR" != "" ]]; then
${ROOT_DIR}/occ config:system:set skeletondirectory --value "$MAIN_SKELETON_DIR"
fi

# Real federated server
if $DESTROY_REAL_FEDERATED_SERVER; then
rm -rf "$REAL_FEDERATED_SERVER_CONFIG_DIR" "$REAL_FEDERATED_SERVER_DATA_DIR"
else
export NEXTCLOUD_CONFIG_DIR="$REAL_FEDERATED_SERVER_CONFIG_DIR"
${ROOT_DIR}/occ app:disable spreedcheats
${ROOT_DIR}/occ config:system:set overwrite.cli.url --value "$REAL_FEDERATED_OVERWRITE_CLI_URL"
if [[ "$REAL_FEDERATED_SKELETON_DIR" != "" ]]; then
${ROOT_DIR}/occ config:system:set skeletondirectory --value "$REAL_FEDERATED_SKELETON_DIR"
fi
fi

rm -rf ../../../spreedcheats
Expand All @@ -213,4 +220,9 @@ wait $PHPPID1
wait $PHPPID2
wait $PHPPID3

echo ''
echo -e "\033[0;36m#\033[0m"
echo -e "\033[0;36m# Gracefully completed\033[0m"
echo -e "\033[0;36m#\033[0m"

exit $RESULT

0 comments on commit db844cd

Please sign in to comment.