-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
65 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
moodle/ | ||
moodle_mod/ | ||
.env | ||
|
||
## Bundle | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
// phpcs:ignoreFile | ||
// Custom Moodle configuration. Is appended to Moodle's own config.php. | ||
|
||
global $CFG; | ||
|
||
// Allow arbitrary hostname (by default it's hardcoded). | ||
if (empty($_SERVER['HTTP_HOST'])) { | ||
$_SERVER['HTTP_HOST'] = '127.0.0.1:8080'; | ||
} | ||
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') { | ||
$CFG->wwwroot = 'https://' . $_SERVER['HTTP_HOST']; | ||
} else { | ||
$CFG->wwwroot = 'http://' . $_SERVER['HTTP_HOST']; | ||
} | ||
|
||
//========================================================================= | ||
// PHPUNIT SUPPORT | ||
//========================================================================= | ||
$CFG->phpunit_prefix = 'phpu_'; | ||
$CFG->phpunit_dataroot = '/var/www/moodledata/phpunit'; | ||
$CFG->phpunit_directorypermissions = 02777; // optional | ||
$CFG->phpunit_profilingenabled = true; // optional to profile PHPUnit runs. | ||
|
||
//========================================================================= | ||
// Custom settings for development | ||
//========================================================================= | ||
|
||
// Force a debugging mode regardless the settings in the site administration | ||
@error_reporting(E_ALL | E_STRICT); // NOT FOR PRODUCTION SERVERS! | ||
@ini_set('display_errors', '1'); // NOT FOR PRODUCTION SERVERS! | ||
$CFG->debug = (E_ALL | E_STRICT); // === DEBUG_DEVELOPER - NOT FOR PRODUCTION SERVERS! | ||
$CFG->debugdisplay = 1; // NOT FOR PRODUCTION SERVERS! | ||
|
||
// Make sure that the temp directories are not deleted during the backup process. Allows easier testing of the backup process. | ||
$CFG->keeptempdirectoriesonbackup = true; | ||
|
||
require_once(__DIR__ . '/lib/setup.php'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
#!/bin/bash | ||
|
||
# see https://docs.moodle.org/404/en/Installing_Moodle#Command_line_installer | ||
# Install Moodle. See https://docs.moodle.org/404/en/Installing_Moodle#Command_line_installer | ||
chown -R www-data /var/www/html | ||
|
||
# TODO: Make moodle default user "user" and not "admin" | ||
su - www-data -s /bin/bash -c "php /var/www/html/admin/cli/install.php --non-interactive --agree-license --allow-unstable --wwwroot=$MOODLE_HOST --dataroot=/var/www/moodledata --dbtype=mariadb --dbhost=$MOODLE_DATABASE_HOST --dbname=moodle --dbuser=moodle --dbport=$MOODLE_DATABASE_PORT_NUMBER --fullname=Moodle --shortname=moodle --adminuser=user --adminpass=$MOODLE_PASSWORD [email protected] [email protected]" | ||
|
||
# Amend the config.php file to include our own config for development. | ||
# The line should be added before the last line "require_once(__DIR__ . '/lib/setup.php');". | ||
sed -i '/require_once/i\require_once(__DIR__ . "/config_kialo.php");' /var/www/html/config.php | ||
|
||
exec /usr/local/bin/moodle-docker-php-entrypoint "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
# Ensure this script is executed in the same folder | ||
cd "$(dirname "$0")" | ||
|
||
# Ensure the directory exists | ||
mkdir -p ./moodle/mod/kialo | ||
|
||
# syncs the content of the development version of this plugin to the copy in the docker moodle installation (/moodle/mod/kialo) | ||
rsync -atm --delete --delete-excluded --exclude={'/development','/.[!.]*'} .. ./moodle/mod/kialo | ||
rsync -atm --delete --delete-excluded --exclude={'/development','/.[!.]*'} .. ./moodle_mod | ||
echo "Synced plugin." | ||
|
||
cp config/config.php moodle/config.php | ||
echo "Synced config.php" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# needs to run once initially and again whenever new tests are added | ||
docker exec -i development-moodle-1 /bin/bash -c "cd /bitnami/moodle; php admin/tool/phpunit/cli/init.php" | ||
docker exec -i mod_kialo-moodle-1 /bin/bash -c "cd /var/www/html; php admin/tool/phpunit/cli/init.php" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
# Ensure files are up-to-date | ||
./sync.sh | ||
|
||
# Run the tests | ||
docker exec -i development-moodle-1 /bin/bash -c "cd /bitnami/moodle; vendor/bin/phpunit --testsuite core_privacy_testsuite --filter kialo" | ||
docker exec -i mod_kialo-moodle-1 /bin/bash -c "cd /var/www/html; vendor/bin/phpunit --testsuite core_privacy_testsuite --filter kialo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
# Ensure files are up-to-date | ||
./sync.sh | ||
|
||
# Run the tests | ||
docker exec -i development-moodle-1 /bin/bash -c "cd /bitnami/moodle; vendor/bin/phpunit --testsuite mod_kialo_testsuite" | ||
docker exec -i mod_kialo-moodle-1 /bin/bash -c "cd /var/www/html; vendor/bin/phpunit --testsuite mod_kialo_testsuite" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Ensure files are up-to-date | ||
./sync.sh | ||
|
||
# Run a specific test file (path relative to mod/kialo/tests) | ||
# Example: ./tests-run.sh classes/mod_kialo_test.php | ||
docker exec -i development-moodle-1 /bin/bash -c "cd /bitnami/moodle; vendor/bin/phpunit mod/kialo/tests/$1" | ||
docker exec -i mod_kialo-moodle-1 /bin/bash -c "cd /var/www/html; vendor/bin/phpunit mod/kialo/tests/$1" |