Skip to content

Commit

Permalink
use git_project instead of GitHub as source + some fixes/improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Glutamat42 committed Dec 15, 2024
1 parent 793acf5 commit 36c2ce7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions opt/adler/entrypoint_adler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 4 additions & 2 deletions opt/adler/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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

Expand Down
8 changes: 4 additions & 4 deletions plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down

0 comments on commit 36c2ce7

Please sign in to comment.