From db67f7848dd07e195841137881e47ee7ef2dcd44 Mon Sep 17 00:00:00 2001 From: Glutamat42 Date: Fri, 5 Apr 2024 04:50:52 +0200 Subject: [PATCH] Add option USER_CREATE_ADLER_COURSE_CATEGORY - refactor setup php code into two files, a dedicated one to install plugins as doing it in the same php script causes problems with class autoloading - add release set 3.1.0 - improve logging and documentation - improve test/docker-compose.yml --- README.md | 71 ++++++--- opt/adler/entrypoint_adler.sh | 2 +- opt/adler/moodle/adler_setup/dependencies.php | 3 + .../moodle/adler_setup/install_plugins.php | 123 +++++++++++++++ opt/adler/moodle/adler_setup/lib.php | 32 +++- opt/adler/moodle/adler_setup/setup.php | 142 +++++++----------- opt/adler/setup.sh | 12 +- plugin-releases.json | 56 +++++-- tests/docker-compose.yml | 15 +- 9 files changed, 324 insertions(+), 132 deletions(-) create mode 100644 opt/adler/moodle/adler_setup/dependencies.php create mode 100644 opt/adler/moodle/adler_setup/install_plugins.php diff --git a/README.md b/README.md index 9f05207..ab48ae0 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,30 @@ # Moodle Bitnami Image Extension - User Creation, PHP Environment Variables, and AdLer Setup + This project extends the bitnami/moodle image with the following features: + - Setting up AdLer (after the first start the Moodle part of AdLer is fully set up). -- Create user(s) on first start +- Create user(s) on first start - Adding another environment variable to set a php.ini option. +## Dependencies +- Requires at least Plugin-Release-Set version 3.1.0 + ## Windows Users -This project works only under Linux. -Git on Windows (also WSL) breaks the line endings which is why it cannot be used there. -Also, editing on Windows can cause the project to stop working on Linux as well. -To use this project on Windows you have to disable the option core.autocrlf -(why the hell does this option exist and why is it enabled by default on Windows...). -To do this run the following command before the git clone `git config --global core.autocrlf false`. + +This project works only under Linux. +Git on Windows (also WSL) breaks the line endings which is why it cannot be used there. +Also, editing on Windows can cause the project to stop working on Linux as well. +To use this project on Windows you have to disable the option core.autocrlf +(why the hell does this option exist and why is it enabled by default on Windows...). +To do this run the following command before the git clone `git config --global core.autocrlf false`. **ATTENTION**: This affects all git repositories on this PC. If you want to run this project with Windows without disabling autocrlf you can use an Docker-twostage approach. I will not support this, but this is an approach you could use to implement it by yourself: + ``` RUN apk add dos2unix RUN cat setup.sh | dos2unix > setup.sh.tmp @@ -26,31 +33,45 @@ RUN chmod +x setup.sh ``` ## Environment variables + +All variables from the bitnami/moodle image are supported. Additionally, the following environment variables can be set: + ### PHP environment variables -| Variable | Description | -|-------------------------|-----------------------------------------------------------------------------------| -| `PHP_OUTPUT_BUFFERING` | Controls the output buffering behavior of PHP. Set it to adjust the buffering setting in the `php.ini` file. | +| Variable | required | Description | +|------------------------|----------|--------------------------------------------------------------------------------------------------------------| +| `PHP_OUTPUT_BUFFERING` | no | Controls the output buffering behavior of PHP. Set it to adjust the buffering setting in the `php.ini` file. | ### Moodle user creation variables -| Variable | Description | -|----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `USER_NAME` | Specifies the login name of a user to be created during the initial setup. Watch out that the default name of the admin user of bitnami/docker is "user" | -| `USER_PASSWORD` | Specifies the password for the user created during the initial setup. Passwords have to follow moodle password validation rules. Otherwise the setup script will break. | -| `USER_FIRST_NAME` | Specifies the first name of the user created during the initial setup. | -| `USER_LAST_NAME` | Specifies the last name of the user created during the initial setup. | -| `USER_EMAIL` | Specifies the email address of the user created during the initial setup. | -| `USER_ROLE` | Specifies the short name of a role to assign to the user created during the initial setup. | +| Variable | required | Description | +|-------------------------------------|-----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `USER_NAME` | no | Specifies the login name of a user to be created during the initial setup. Watch out that the default name of the admin user of bitnami/docker is "user" | +| `USER_PASSWORD` | if `USER_NAME` is specified | Specifies the password for the user created during the initial setup. Passwords have to follow moodle password validation rules. Otherwise the setup script will break. | +| `USER_FIRST_NAME` | no | Specifies the first name of the user created during the initial setup. | +| `USER_LAST_NAME` | no | Specifies the last name of the user created during the initial setup. | +| `USER_EMAIL` | no | Specifies the email address of the user created during the initial setup. | +| `USER_ROLE` | no | Specifies the short name of a page wide (system) role to assign to the user created during the initial setup. This is mostly useful for moodle administration accounts | +| `USER_CREATE_ADLER_COURSE_CATEGORY` | no | true \| false - If true a course category will be created for the user where has the role "adler_manager" | + +### Other environment variables + +| Variable | required | Description | +|--------------------------------|----------|--------------------------------------------------------------------------------------------------------| +| `DEVELOP_DONT_INSTALL_PLUGINS` | no | true \| false - If true the setup script will not install any plugins. This is useful for development. | #### Examples + Example one user + ``` USER_NAME=john_doe USER_PASSWORD=Pass1234 USER_FIRST_NAME=John ``` + Example three users + ``` USER_NAME=user1,user2,user3 USER_PASSWORD=Secret123,Secret123,Pass1234 @@ -61,9 +82,11 @@ USER_ROLE=false,manager,false ``` ## Sample docker-compose.yml + see [tests/docker-compose.yml](tests/docker-compose.yml) ## Updating moodle + > [!IMPORTANT] > The moodle release is NOT updated automatically in any way! \ > Incrementing MOODLE_VERSION build arg will not result in an update of moodle. @@ -72,8 +95,8 @@ Moodle updates have to be done manually (Plugins are not affected by this issue) Follow the [Bitnami Moodle Upgrade Guide](https://docs.bitnami.com/aws/apps/moodle/administration/upgrade/). Sadly it is not easy to automate that process as moodle itself does not provide a way to automatically update moodle. -It might be within the realm of possibility to provide AdLer images with moodle and Plugins preinstalled, -but with this approach all additional plugins would be deleted after every update (potentially breaking moodle). +It might be within the realm of possibility to provide AdLer images with moodle and Plugins preinstalled, +but with this approach all additional plugins would be deleted after every update (potentially breaking moodle). A possible approach to mitigate this issue might be placing an overlay volume on top of the whole moodle directory of this moodle image. But it is unknown whether this would work and what potential issues might arise from this. @@ -85,4 +108,10 @@ When building the Docker image for this project, you can customize the following - `MOODLE_VERSION`: Specifies the version of Moodle to be used in the image. The default value is `latest`. - `PLUGIN_VERSION`: Specifies the version of the Moodle plugin to be included in the image. The default value is `main`. -These arguments allow you to control the versions of Moodle and the plugin that are used during the image build process. You can adjust these values according to your specific requirements and preferences. +These arguments allow you to control the versions of Moodle and the plugin that are used during the image build process. You can adjust these values according to your specific +requirements and preferences. + +## Troubleshooting + +**Moodle setup fails with "The configuration file config.php alreaady exists. ...":** \ +This typically indicates the setup script already failed during a previous run. Have a look on the logs of the first execution. \ No newline at end of file diff --git a/opt/adler/entrypoint_adler.sh b/opt/adler/entrypoint_adler.sh index c02f7d4..9c3e0c5 100755 --- a/opt/adler/entrypoint_adler.sh +++ b/opt/adler/entrypoint_adler.sh @@ -13,7 +13,7 @@ # inject adler update if ! grep "/opt/adler/setup.sh" /opt/bitnami/scripts/moodle/entrypoint.sh > /dev/null ; then echo "inject adler update" - sed -i '/^exec "$@".*/i /opt/adler/setup.sh' /opt/bitnami/scripts/moodle/entrypoint.sh + sed -i '/^exec "$@".*/i echo "starting adler setup script" && /opt/adler/setup.sh' /opt/bitnami/scripts/moodle/entrypoint.sh fi diff --git a/opt/adler/moodle/adler_setup/dependencies.php b/opt/adler/moodle/adler_setup/dependencies.php new file mode 100644 index 0000000..e9f4c72 --- /dev/null +++ b/opt/adler/moodle/adler_setup/dependencies.php @@ -0,0 +1,3 @@ +libdir . "/clilib.php"); +require_once("lib.php"); + + +## cli opts +$help = "Command line tool to uninstall plugins. + +Options: + -h --help Print this help. + --plugin_version Version of AdLer plugins to install. main or exact release name. Defaults to main. + --develop_dont_install_plugins DEVELOP OPTION: Skip plugin installation +"; + +list($options, $unrecognised) = cli_get_params([ + 'help' => false, + 'plugin_version' => 'main', + 'develop_dont_install_plugins' => false, +], []); + +if ($unrecognised) { + $unrecognised = implode(PHP_EOL . ' ', $unrecognised); + cli_error('unknown option(s):' . $unrecognised); +} + + +if ($options['help']) { + cli_writeln($help); + exit(0); +} + +# cast boolean cli opts +$options['develop_dont_install_plugins'] = $options['develop_dont_install_plugins'] == "true"; +## end cli opts +cli_writeln('CLI options: ' . json_encode($options)); + + +// validate plugin version +if (version_compare($options['plugin_version'], $MINIMUM_PLUGIN_RELEASE_SET, '<') && $options['plugin_version'] !== 'main') { + cli_error("Plugin version is too low. Minimum required version is $MINIMUM_PLUGIN_RELEASE_SET"); +} + + +function get_plugin_config() { + $url = __DIR__ . '/plugin-releases.json'; +// $url = 'https://raw.githubusercontent.com/Glutamat42/moodle-docker/main/plugin-releases.json'; + $file_content = file_get_contents($url); + return json_decode($file_content, true); +} + + +if ($options['develop_dont_install_plugins']) { + cli_writeln("skipping plugin installation"); +} else { + cli_writeln("installing plugins"); + + $plugin_release_info = get_plugin_config(); + + $plugins = []; + if (isset($plugin_release_info['common_versions'][$options['plugin_version']])) { + foreach ($plugin_release_info['common_versions'][$options['plugin_version']] as $plugin) { + $path = $CFG->dirroot . $plugin['path']; + + if (preg_match('/^[0-9]+(\.[0-9]+){0,2}(-rc(\.[0-9]+)?)?$/', $plugin['version'])) { + // plugin is a release + $info = get_updated_release_info( + $plugin['git_project'], + $plugin['version'], + core_plugin_manager::instance()->get_plugin_info($plugin['name'])->release + ); + + if ($info === false) { + cli_writeln("No update available for {$plugin['name']} {$plugin['version']}"); + continue; + } else if ($info !== null && property_exists($info, 'tag_name')) { + // checking for one of the keys is sufficient + $url = $info->zip_url; + } else { + cli_error("Failed to get release info for {$plugin['name']} {$plugin['version']}"); + } + } else { + // plugin is a branch + $url = "https://github.com/" . $plugin['git_project'] . "/archive/refs/heads/" . $plugin['version'] . ".zip"; + } + + /** @noinspection PhpUndefinedVariableInspection */ + $plugins[] = [ + "path" => $path, + "url" => $url + ]; + } + } else { + cli_error("plugin version not found"); + } + + cli_writeln("plugins to install: " . json_encode($plugins)); + foreach ($plugins as $plugin) { + update_plugin($plugin); + } +} + +// upgrade moodle installation +cli_writeln("Upgrading moodle installation..."); +$cmd = "php {$CFG->dirroot}/admin/cli/upgrade.php --non-interactive --allow-unstable"; +cli_writeln("Executing: $cmd"); +exec($cmd, $blub, $result_code); +if ($result_code != 0) { + cli_error('command execution failed'); +} diff --git a/opt/adler/moodle/adler_setup/lib.php b/opt/adler/moodle/adler_setup/lib.php index 9274e63..513f30f 100644 --- a/opt/adler/moodle/adler_setup/lib.php +++ b/opt/adler/moodle/adler_setup/lib.php @@ -1,11 +1,11 @@ dirroot . '/user/profile/lib.php'); require_once($CFG->dirroot . '/user/lib.php'); - -use core_plugin_manager; -use \core\event\user_created; +use local_adler\plugin_interface; +use core\event\user_created; /** Get Infos (incl download urls) of release to update to. Will return false if nothing to update @@ -139,6 +139,19 @@ function create_users($options) { $users_data['last_name'] = $options['user_last_name'] ? explode(',', $options['user_last_name']) : array_fill(0, count($users_data['name']), "false"); $users_data['email'] = $options['user_email'] ? explode(',', $options['user_email']) : array_fill(0, count($users_data['name']), "false"); $users_data['role'] = $options['user_role'] ? explode(',', $options['user_role']) : array_fill(0, count($users_data['name']), "false"); + $users_data['create_adler_course_category'] = $options['user_create_adler_course_category'] ? explode(',', $options['user_create_adler_course_category']) : array_fill(0, count($users_data['name']), "false"); + + // trim all values + foreach (array_keys($users_data) as $key) { + $users_data[$key] = array_map('trim', $users_data[$key]); + } + + // in case any value is empty, set to false + foreach (array_keys($users_data) as $key) { + $users_data[$key] = array_map(function ($value) { + return empty($value) ? "false" : $value; + }, $users_data[$key]); + } // validation foreach (array_keys($users_data) as $key) { @@ -147,11 +160,22 @@ function create_users($options) { for ($i = 0; $i < count($users_data['name']); $i++) { + // for optional fields, fill with default values if not set $first_name = $users_data['first_name'][$i] != "false" ? $users_data['first_name'][$i] : $users_data['name'][$i]; $last_name = $users_data['last_name'][$i] != "false" ? $users_data['last_name'][$i] : $users_data['name'][$i]; $role = $users_data['role'][$i] == "false" ? false : $users_data['role'][$i]; $email = $users_data['email'][$i] != "false" ?: $users_data['name'][$i] . '@example.example'; - create_one_user($users_data['name'][$i], $users_data['password'][$i], $first_name, $last_name, $email, $role); + $user = create_one_user($users_data['name'][$i], $users_data['password'][$i], $first_name, $last_name, $email, $role); + + if ($users_data['create_adler_course_category'][$i] == "true") { + cli_writeln("creating course category with upload permission for user " . $user->username); + create_default_course_category_for_user($user->username); + } } } + +function create_default_course_category_for_user($username) { + // use local_adler cli script + plugin_interface::create_category_user_can_create_courses_in($username, 'adler_manager'); +} diff --git a/opt/adler/moodle/adler_setup/setup.php b/opt/adler/moodle/adler_setup/setup.php index ab9b012..9e914a8 100644 --- a/opt/adler/moodle/adler_setup/setup.php +++ b/opt/adler/moodle/adler_setup/setup.php @@ -1,8 +1,4 @@ libdir . "/clilib.php"); require_once($CFG->libdir . "/moodlelib.php"); -require_once($CFG->libdir . "/externallib.php"); require_once($CFG->libdir . "/accesslib.php"); require_once("lib.php"); @@ -23,29 +18,27 @@ $help = "Command line tool to uninstall plugins. Options: - -h --help Print this help. - --first_run Set this flag if this script is run the first time - --plugin_version Version of AdLer plugins to install. main or exact release name. Defaults to main. - --user_name Plain user that will be created during first_run. This user does not have any special permissions, it will be a default \"student\". This field will be the login name and used as default value for optional fields. name and password parameters are required if this user should be created. This is a comma separated list. To add multiple users use for example --user_name=user1,user,user3. All used switches has to have the same array length. Use false if you want the default behavior (eg --user_first_name=John,false,Peter) - --user_password Passwords are not allowed to contain \",\". Passwords have to follow moodle password validation rules. - --user_first_name - --user_last_name - --user_email - --user_role shortname of one role - --develop_dont_install_plugins DEVELOP OPTION: Skip plugin installation + -h --help Print this help. + --first_run Set this flag if this script is run the first time + --user_name Comma seperated list of users that will be created during first_run. Per default the users do not have any special permissions, it will be a default \"student\". This field will be the login name and used as default value for optional fields. Name and password parameters are required if this user should be created. To add multiple users use for example --user_name=user1,user,user3. All used switches have to have the same array length. Use false if you want the default behavior (eg --user_first_name=John,false,Peter) + --user_password Passwords are not allowed to contain \",\". Passwords have to follow moodle password validation rules. + --user_first_name See user_name for further information. + --user_last_name See user_name for further information. + --user_email See user_name for further information. + --user_role shortname of role. See user_name for further information. + --user_create_adler_course_category true: create a course category for the user and assign the account to the adler_manager role in the context of this course category. See user_name for further information. "; list($options, $unrecognised) = cli_get_params([ 'help' => false, 'first_run' => false, - 'plugin_version' => 'main', 'user_name' => false, 'user_password' => false, 'user_first_name' => false, 'user_last_name' => false, 'user_email' => false, 'user_role' => false, - 'develop_dont_install_plugins' => false, + 'user_create_adler_course_category' => false, ], []); if ($unrecognised) { @@ -53,7 +46,6 @@ cli_error('unknown option(s):' . $unrecognised); } - if ($options['help']) { cli_writeln($help); exit(0); @@ -61,15 +53,57 @@ # cast boolean cli opts $options['first_run'] = $options['first_run'] == "true"; -$options['develop_dont_install_plugins'] = $options['develop_dont_install_plugins'] == "true"; ## end cli opts cli_writeln('CLI options: ' . json_encode((object) array_merge((array) $options, ['user_password' => '***']))); + +function do_adler_roles_exist() { + $roles = get_all_roles(); + $filtered_roles = array_filter($roles, function($role) { + return $role->name == 'adler_manager'; + }); + + return !empty($filtered_roles); +} + +// check if adler roles already exist +if (do_adler_roles_exist()) { + cli_writeln("adler roles already exist"); +} else { + // create adler role + $role_adler_manager_id = create_role('adler_manager', 'adler_manager', 'Manager for adler courses. Has all permissions required to work with the authoring tool.', 'user'); + $capabilities_adler_manager = [ + 'moodle/course:delete', + 'moodle/course:enrolconfig', + 'moodle/question:add', + 'moodle/question:managecategory', + 'moodle/restore:configure', + 'moodle/restore:restoreactivity', + 'moodle/restore:restorecourse', + 'moodle/restore:restoresection', + 'moodle/restore:restoretargetimport', + 'moodle/restore:rolldates', + 'moodle/restore:uploadfile', + 'moodle/restore:userinfo', + 'moodle/restore:viewautomatedfilearea' + ]; + foreach ($capabilities_adler_manager as $capability) { + assign_capability($capability, CAP_ALLOW, $role_adler_manager_id, context_system::instance()); + } + // set context levels where the role can be assigned + $contextlevels = [ + CONTEXT_COURSECAT, + ]; + set_role_contextlevels($role_adler_manager_id, $contextlevels); +} + + if ($options['first_run']) { // enable webservices set_config('enablewebservices', true); // enable moodle mobile web service + // TODO: we are not using moodle official mobile service anymore // set_config('enablemobilewebservice', true); // for any reason this does not set the corresponding option in the web ui and everything seems to work without it anyway. $external_service_record = $DB->get_record('external_services', array('shortname' => MOODLE_OFFICIAL_MOBILE_SERVICE)); $external_service_record->enabled = 1; @@ -112,72 +146,4 @@ cli_writeln("creating user(s)"); create_users($options); } -} - -function get_plugin_config() { - $url = __DIR__ . '/plugin-releases.json'; -// $url = 'https://raw.githubusercontent.com/Glutamat42/moodle-docker/main/plugin-releases.json'; - $file_content = file_get_contents($url); - return json_decode($file_content, true); -} - - -if ($options['develop_dont_install_plugins']) { - cli_writeln("skipping plugin installation"); -} else { - cli_writeln("installing plugins"); - - $plugin_release_info = get_plugin_config(); - - $plugins = []; - if (isset($plugin_release_info['common_versions'][$options['plugin_version']])) { - foreach ($plugin_release_info['common_versions'][$options['plugin_version']] as $plugin) { - $path = $CFG->dirroot . $plugin['path']; - - if (preg_match('/^[0-9]+(\.[0-9]+){0,2}(-rc(\.[0-9]+)?)?$/', $plugin['version'])) { - // plugin is a release - $info = get_updated_release_info( - $plugin['git_project'], - $plugin['version'], - core_plugin_manager::instance()->get_plugin_info($plugin['name'])->release - ); - - if ($info === false) { - cli_writeln("No update available for {$plugin['name']} {$plugin['version']}"); - continue; - } else if ($info !== null && property_exists($info, 'tag_name')) { - // checking for one of the keys is sufficient - $url = $info->zip_url; - } else { - cli_error("Failed to get release info for {$plugin['name']} {$plugin['version']}"); - } - } else { - // plugin is a branch - $url = "https://github.com/" . $plugin['git_project'] . "/archive/refs/heads/" . $plugin['version'] . ".zip"; - } - - /** @noinspection PhpUndefinedVariableInspection */ - $plugins[] = [ - "path" => $path, - "url" => $url - ]; - } - } else { - cli_error("plugin version not found"); - } - - cli_writeln("plugins to install: " . json_encode($plugins)); - foreach ($plugins as $plugin) { - update_plugin($plugin); - } -} - - -// upgrade moodle installation -cli_writeln("Upgrading moodle installation..."); -$cmd = "php {$CFG->dirroot}/admin/cli/upgrade.php --non-interactive --allow-unstable"; -cli_writeln("Executing: $cmd"); -exec($cmd, $blub, $result_code); -if ($result_code != 0) { - cli_error('command execution failed'); -} +} \ No newline at end of file diff --git a/opt/adler/setup.sh b/opt/adler/setup.sh index 6bfa445..b42a584 100755 --- a/opt/adler/setup.sh +++ b/opt/adler/setup.sh @@ -11,6 +11,16 @@ fi rm -r -f /bitnami/moodle/adler_setup # cleanup first cp -r /opt/adler/moodle/adler_setup /bitnami/moodle/ chown -R daemon /bitnami/moodle/adler_setup -su daemon -s /bin/sh -c "php /bitnami/moodle/adler_setup/setup.php --first_run=$first_run ${USER_NAME:+--user_name=$USER_NAME} ${USER_PASSWORD:+--user_password=$USER_PASSWORD} ${USER_FIRST_NAME:+--user_first_name=$USER_FIRST_NAME} ${USER_LAST_NAME:+--user_last_name=$USER_LAST_NAME} ${USER_EMAIL:+--user_email=$USER_EMAIL} ${USER_ROLE:+--user_role=$USER_ROLE} ${PLUGIN_VERSION:+--plugin_version=$PLUGIN_VERSION} ${DEVELOP_DONT_INSTALL_PLUGINS:+--develop_dont_install_plugins=$DEVELOP_DONT_INSTALL_PLUGINS}" + +su daemon -s /bin/sh -c "php /bitnami/moodle/adler_setup/install_plugins.php ${PLUGIN_VERSION:+--plugin_version=\"$PLUGIN_VERSION\"} ${DEVELOP_DONT_INSTALL_PLUGINS:+--develop_dont_install_plugins=\"$DEVELOP_DONT_INSTALL_PLUGINS\"}" +if [ $? -ne 0 ]; then + echo "install_plugins.php failed" + exit 1 +fi +su daemon -s /bin/sh -c "php /bitnami/moodle/adler_setup/setup.php --first_run=\"$first_run\" ${USER_NAME:+--user_name=\"$USER_NAME\"} ${USER_PASSWORD:+--user_password=\"$USER_PASSWORD\"} ${USER_FIRST_NAME:+--user_first_name=\"$USER_FIRST_NAME\"} ${USER_LAST_NAME:+--user_last_name=\"$USER_LAST_NAME\"} ${USER_EMAIL:+--user_email=\"$USER_EMAIL\"} ${USER_ROLE:+--user_role=\"$USER_ROLE\"} ${USER_CREATE_ADLER_COURSE_CATEGORY:+--user_create_adler_course_category=\"$USER_CREATE_ADLER_COURSE_CATEGORY\"}" +if [ $? -ne 0 ]; then + echo "setup.php failed" + exit 1 +fi echo "finished adler setup/update script" diff --git a/plugin-releases.json b/plugin-releases.json index f1eaff6..720a76d 100644 --- a/plugin-releases.json +++ b/plugin-releases.json @@ -1,37 +1,43 @@ { "common_versions": { - "1.0.0": [ + "main": [ { "git_project": "ProjektAdLer/MoodlePluginLocal", - "version": "1.0.0", + "version": "main", "path": "/local/adler", "name": "local_adler" }, { "git_project": "ProjektAdler/MoodlePluginAvailability", - "version": "1.0.0", + "version": "main", "path": "/availability/condition/adler", "name": "availability_adler" + }, + { + "git_project": "ProjektAdLer/MoodlePluginModAdleradaptivity", + "version": "main", + "path": "/mod/adleradaptivity", + "name": "mod_adleradaptivity" + }, + { + "git_project": "ProjektAdLer/MoodlePluginLocalLogging", + "version": "main", + "path": "/local/logging", + "name": "local_logging" } ], - "main": [ + "1.0.0": [ { "git_project": "ProjektAdLer/MoodlePluginLocal", - "version": "main", + "version": "1.0.0", "path": "/local/adler", "name": "local_adler" }, { "git_project": "ProjektAdler/MoodlePluginAvailability", - "version": "main", + "version": "1.0.0", "path": "/availability/condition/adler", "name": "availability_adler" - }, - { - "git_project": "ProjektAdLer/MoodlePluginModAdleradaptivity", - "version": "main", - "path": "/mod/adleradaptivity", - "name": "mod_adleradaptivity" } ], "2.0.0-rc": [ @@ -93,6 +99,32 @@ "path": "/mod/adleradaptivity", "name": "mod_adleradaptivity" } + ], + "3.1.0": [ + { + "git_project": "ProjektAdLer/MoodlePluginLocal", + "version": "3.1.0", + "path": "/local/adler", + "name": "local_adler" + }, + { + "git_project": "ProjektAdler/MoodlePluginAvailability", + "version": "3.0.0", + "path": "/availability/condition/adler", + "name": "availability_adler" + }, + { + "git_project": "ProjektAdLer/MoodlePluginModAdleradaptivity", + "version": "2.1.0", + "path": "/mod/adleradaptivity", + "name": "mod_adleradaptivity" + }, + { + "git_project": "ProjektAdLer/MoodlePluginLocalLogging", + "version": "0.1.0", + "path": "/local/logging", + "name": "local_logging" + } ] } } diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index 73c236b..03e6029 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -4,8 +4,9 @@ services: build: context: .. args: - PLUGIN_VERSION: 1.0.0 - MOODLE_VERSION: 4.2 +# PLUGIN_VERSION: main + PLUGIN_VERSION: 3.1.0 + MOODLE_VERSION: 4.3 ports: - '8000:8080' environment: @@ -19,8 +20,10 @@ services: MOODLE_DATABASE_PASSWORD: moodle MOODLE_DATABASE_NAME: moodle USER_NAME: student,manager - USER_PASSWORD: Student1234!1234,Manager1234!1234 - USER_ROLE: false,manager + USER_PASSWORD: Student1234.1234,Manager1234.1234 + USER_ROLE: false,false + USER_CREATE_ADLER_COURSE_CATEGORY: "false, true" + BITNAMI_DEBUG: true volumes: - moodle_moodle:/bitnami/moodle - moodle_moodledata:/bitnami/moodledata @@ -29,7 +32,9 @@ services: restart: unless-stopped db_moodle: - image: docker.io/bitnami/mariadb:10.6 + image: bitnami/mariadb:10.11 + ports: + - '3306:3306' environment: MARIADB_USER: moodle MARIADB_PASSWORD: moodle