From 36c2ce72457acc033c20a030b083e8cdf123fb58 Mon Sep 17 00:00:00 2001 From: Glutamat42 Date: Sun, 15 Dec 2024 01:33:21 +0100 Subject: [PATCH] use git_project instead of GitHub as source + some fixes/improvements --- opt/adler/entrypoint_adler.sh | 4 ++-- opt/adler/setup.sh | 6 ++++-- plugins.json | 8 ++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/opt/adler/entrypoint_adler.sh b/opt/adler/entrypoint_adler.sh index a811327..235ab38 100755 --- a/opt/adler/entrypoint_adler.sh +++ b/opt/adler/entrypoint_adler.sh @@ -10,9 +10,9 @@ ! is_empty_value "$PHP_OUTPUT_BUFFERING" && info "Setting PHP output_buffering option" && php_conf_set output_buffering "$PHP_OUTPUT_BUFFERING" "$PHP_CONF_FILE" -# inject adler update +# inject adler setup script if ! grep "/opt/adler/setup.sh" /opt/bitnami/scripts/moodle/entrypoint.sh > /dev/null ; then - echo "inject adler update" + echo "inject adler setup script" sed -i '/^exec "$@".*/i echo "starting adler setup script" && su daemon -s /bin/bash -c "/opt/adler/setup.sh"' /opt/bitnami/scripts/moodle/entrypoint.sh fi diff --git a/opt/adler/setup.sh b/opt/adler/setup.sh index 09839b2..e479e12 100755 --- a/opt/adler/setup.sh +++ b/opt/adler/setup.sh @@ -24,6 +24,7 @@ if [ ! -d "$TARGET_DIR" ]; then fi # Extract the zip file to the target directory + echo "Extracting the zip file to $TARGET_DIR" unzip -q "$ZIP_FILE" -d "$(dirname "$TARGET_DIR")" if [ $? -ne 0 ]; then echo "Failed to extract the zip file to $TARGET_DIR" @@ -34,6 +35,7 @@ if [ ! -d "$TARGET_DIR" ]; then rm "$ZIP_FILE" # Run the upgrade script + echo "Running the upgrade script" php admin/cli/upgrade.php --non-interactive if [ $? -ne 0 ]; then @@ -47,8 +49,8 @@ fi #### install main playbook (installing all plugins and potential further playbooks) echo "installing adler playbook" ADLER_PLAYBOOK_VERSION=$(jq -r '.[] | select(.name == "playbook_adler") | .version' /opt/adler/plugins.json) -# TODO: package repo or github repo from version.json -php local/declarativesetup/cli/install_plugin.php --package-repo=https://packages.projekt-adler.eu/packages/playbook_adler --version="$ADLER_PLAYBOOK_VERSION" --moodle-name=playbook_adler +ADLER_PLAYBOOK_PACKAGE_REPO=$(jq -r '.[] | select(.name == "playbook_adler") | .package_repo' /opt/adler/plugins.json) +php local/declarativesetup/cli/install_plugin.php --package-repo=$ADLER_PLAYBOOK_PACKAGE_REPO --version="$ADLER_PLAYBOOK_VERSION" --moodle-name=playbook_adler # copy plugins.json to playbook cp /opt/adler/plugins.json local/declarativesetup/playbook/adler/files/plugins.json diff --git a/plugins.json b/plugins.json index 6ee555d..91927e6 100644 --- a/plugins.json +++ b/plugins.json @@ -10,22 +10,22 @@ "name": "playbook_adler" }, { - "git_project": "ProjektAdLer/MoodlePluginLocal", + "package_repo": "https://packages.projekt-adler.eu/packages/moodle/", "version": "5.0.0", "name": "local_adler" }, { - "git_project": "ProjektAdler/MoodlePluginAvailability", + "package_repo": "https://packages.projekt-adler.eu/packages/moodle/", "version": "4.0.1", "name": "availability_adler" }, { - "git_project": "ProjektAdLer/MoodlePluginModAdleradaptivity", + "package_repo": "https://packages.projekt-adler.eu/packages/moodle/", "version": "3.0.0", "name": "mod_adleradaptivity" }, { - "git_project": "ProjektAdLer/MoodlePluginLocalLogging", + "package_repo": "https://packages.projekt-adler.eu/packages/moodle/", "version": "1.0.0", "name": "local_logging" }