-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Fix restoring the domain and skeleton of the main and real-fed se… #13581
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" != "" && -d $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" != "" && -d $REAL_FEDERATED_SKELETON_DIR ]]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. |
||
echo "Resetting custom skeletondirectory so that tests pass" | ||
${ROOT_DIR}/occ config:system:delete skeletondirectory | ||
fi | ||
|
||
echo '' | ||
echo -e "\033[0;36m#\033[0m" | ||
|
@@ -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" != "" && -d $MAIN_SKELETON_DIR ]]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above (ok, not exactly the same because here is the restoring). |
||
${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" | ||
rm -rf "'$REAL_FEDERATED_SERVER_CONFIG_DIR'" "'$REAL_FEDERATED_SERVER_DATA_DIR'" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the single quotes inside the double quotes? 🤔 |
||
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" != "" && -d $REAL_FEDERATED_SKELETON_DIR ]]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. |
||
${ROOT_DIR}/occ config:system:set skeletondirectory --value "$REAL_FEDERATED_SKELETON_DIR" | ||
fi | ||
fi | ||
|
||
rm -rf ../../../spreedcheats | ||
|
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be simply tested if the value is set, rather than if it is set and the directory exist? If it is set but it does not exist the tests would use it rather than the default skeleton directory*, which would make the tests fail if they are expecting some file from the default skeleton directory.
*Unless there is a fallback in Nextcloud code in case the configured skeleton directory does not exist, I have not checked that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah that might have been an attempt to find the root cause on my side. The problem turned out to be the overwriting from 2 different servers 🙈