File tree Expand file tree Collapse file tree 7 files changed +53
-8
lines changed Expand file tree Collapse file tree 7 files changed +53
-8
lines changed Original file line number Diff line number Diff line change 1818# Clone Moodle repository.
1919cd " ${GITPOD_REPO_ROOT} " && git clone ${FASTCLONE} --branch " ${MOODLE_BRANCH} " --single-branch " ${MOODLE_REPOSITORY} " moodle
2020
21+ if [ -d " moodle/public" ];
22+ then
23+ MOODLE_PUBLIC_ROOT=" moodle/public"
24+ else
25+ MOODLE_PUBLIC_ROOT=" moodle"
26+ fi
27+
2128# Download the data file (if given). It will be used to generate some data.
2229if [ -n " $DATAFILE " ];
2330then
24- wget -O moodle /admin/tool/generator/tests/fixtures/gitpod-basic-scenario.feature " ${DATAFILE} "
31+ wget -O ${MOODLE_PUBLIC_ROOT} /admin/tool/generator/tests/fixtures/gitpod-basic-scenario.feature " ${DATAFILE} "
2532fi
2633
2734# Install adminer.
Original file line number Diff line number Diff line change 9898if [[ -z " $MOODLE_DOCKER_APP_NODE_VERSION " ]] && [[ ! -z " $MOODLE_DOCKER_APP_PATH " ]];
9999then
100100 appnodeversion=" $( cat $MOODLE_DOCKER_APP_PATH /.nvmrc | sed -E " s/v(([0-9]+\.?)+)/\1/" || true) "
101+ appnodeversion=" ${appnodeversion// \/ / -} "
101102
102103 export MOODLE_DOCKER_APP_NODE_VERSION=" $appnodeversion "
103104fi
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22set -e
33basedir=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) /../" && pwd ) "
4- initcmd=" bin/moodle-docker-compose exec -T webserver php admin/tool/behat/cli/init.php"
54
65export MOODLE_DOCKER_WWWROOT=" ${basedir} /moodle"
6+ if [ -d " ${MOODLE_DOCKER_WWWROOT} /public" ];
7+ then
8+ MOODLE_BEHAT_CLI_ROOT=" public/admin/tool/behat/cli"
9+ else
10+ MOODLE_BEHAT_CLI_ROOT=" admin/tool/behat/cli"
11+ fi
12+
713export MOODLE_DOCKER_BROWSER=chrome
814export MOODLE_DOCKER_DB=pgsql
915
16+ initcmd=" bin/moodle-docker-compose exec -T webserver php ${MOODLE_BEHAT_CLI_ROOT} /init.php"
17+
1018if [ " $SUITE " = " app-development" ];
1119then
1220 export MOODLE_DOCKER_APP_PATH=" ${basedir} /app"
1927 echo -e " \nunsafe-perm=true" >> $basedir /app/.npmrc
2028 fi
2129
22- nodeversion=" $( cat $MOODLE_DOCKER_APP_PATH /.nvmrc | grep -oP ' (\d+\.?)+' || true) "
30+ nodeversion=" $( cat $MOODLE_DOCKER_APP_PATH /.nvmrc | sed -E " s/v(([0-9]+\.?)+)/\1/" || true) "
31+ nodeversion=" ${nodeversion// \/ / -} "
2332
2433 docker run --volume $basedir /app:/app --workdir /app node:$nodeversion bash -c " npm ci"
2534elif [ " $SUITE " = " app" ];
Original file line number Diff line number Diff line change @@ -7,9 +7,16 @@ export MOODLE_DOCKER_WWWROOT="${basedir}/moodle"
77export MOODLE_DOCKER_BROWSER=chrome
88export MOODLE_DOCKER_DB=pgsql
99
10+ if [ -d " ${MOODLE_DOCKER_WWWROOT} /public" ];
11+ then
12+ MOODLE_BEHAT_CLI_ROOT=" public/admin/tool/behat/cli"
13+ else
14+ MOODLE_BEHAT_CLI_ROOT=" admin/tool/behat/cli"
15+ fi
16+
1017if [ " $SUITE " = " app" ] || [ " $SUITE " = " app-development" ];
1118then
12- testcmd=" bin/moodle-docker-compose exec -T webserver php admin/tool/behat/cli /run.php --tags=@app&&@moodledocker"
19+ testcmd=" bin/moodle-docker-compose exec -T webserver php ${MOODLE_BEHAT_CLI_ROOT} /run.php --tags=@app&&@moodledocker"
1320else
1421 echo " Error, unknown suite '$SUITE '"
1522 exit 1
Original file line number Diff line number Diff line change @@ -4,9 +4,16 @@ basedir="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"
44
55export MOODLE_DOCKER_WWWROOT=" ${basedir} /moodle"
66
7+ if [ -d " ${MOODLE_DOCKER_WWWROOT} /public" ];
8+ then
9+ MOODLE_BEHAT_CLI_ROOT=" public/admin/tool/behat/cli"
10+ else
11+ MOODLE_BEHAT_CLI_ROOT=" admin/tool/behat/cli"
12+ fi
13+
714if [ " $SUITE " = " behat" ];
815then
9- initcmd=" bin/moodle-docker-compose exec -T webserver php admin/tool/behat/cli /init.php"
16+ initcmd=" bin/moodle-docker-compose exec -T webserver php ${MOODLE_BEHAT_CLI_ROOT} /init.php"
1017else
1118 echo " Error, unknown suite '$SUITE '"
1219 exit 1
Original file line number Diff line number Diff line change @@ -5,9 +5,16 @@ basedir="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"
55
66export MOODLE_DOCKER_WWWROOT=" ${basedir} /moodle"
77
8+ if [ -d " ${MOODLE_DOCKER_WWWROOT} /public" ];
9+ then
10+ MOODLE_BEHAT_CLI_ROOT=" public/admin/tool/behat/cli"
11+ else
12+ MOODLE_BEHAT_CLI_ROOT=" admin/tool/behat/cli"
13+ fi
14+
815if [ " $SUITE " = " behat" ];
916then
10- testcmd=" bin/moodle-docker-compose exec -T webserver php admin/tool/behat/cli /run.php --tags=@auth_manual"
17+ testcmd=" bin/moodle-docker-compose exec -T webserver php ${MOODLE_BEHAT_CLI_ROOT} /run.php --tags=@auth_manual"
1118else
1219 echo " Error, unknown suite '$SUITE '"
1320 exit 1
Original file line number Diff line number Diff line change @@ -4,14 +4,21 @@ basedir="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"
44
55export MOODLE_DOCKER_WWWROOT=" ${basedir} /moodle"
66
7+ if [ -d " ${MOODLE_DOCKER_WWWROOT} /public" ];
8+ then
9+ MOODLE_PHPUNIT_CLI_ROOT=" public/admin/tool/phpunit/cli"
10+ else
11+ MOODLE_PHPUNIT_CLI_ROOT=" admin/tool/phpunit/cli"
12+ fi
13+
714if [ " $SUITE " = " phpunit" ];
815then
9- initcmd=" bin/moodle-docker-compose exec -T webserver php admin/tool/phpunit/cli /init.php"
16+ initcmd=" bin/moodle-docker-compose exec -T webserver php ${MOODLE_PHPUNIT_CLI_ROOT} /init.php"
1017elif [ " $SUITE " = " phpunit-full" ];
1118then
1219 export MOODLE_DOCKER_PHPUNIT_EXTERNAL_SERVICES=true
1320 export MOODLE_DOCKER_MLBACKEND=true
14- initcmd=" bin/moodle-docker-compose exec -T webserver php admin/tool/phpunit/cli /init.php"
21+ initcmd=" bin/moodle-docker-compose exec -T webserver php ${MOODLE_PHPUNIT_CLI_ROOT} /init.php"
1522else
1623 echo " Error, unknown suite '$SUITE '"
1724 exit 1
You can’t perform that action at this time.
0 commit comments