Skip to content

Commit 43f2b90

Browse files
authored
Merge pull request #132 from NoelDeMartin/standarize-env-variables
Rename MOODLE_APP_VERSION to MOODLE_DOCKER_APP_VERSION
2 parents b2e6c7f + f67080f commit 43f2b90

File tree

6 files changed

+26
-7
lines changed

6 files changed

+26
-7
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ install:
6666
- export MOODLE_DOCKER_WWWROOT="$HOME/moodle"
6767
- export MOODLE_DOCKER_PHP_VERSION=$PHP
6868
- export MOODLE_DOCKER_APP_PATH=$APP_PATH
69-
- export MOODLE_APP_VERSION=$APP_VERSION
69+
- export MOODLE_DOCKER_APP_VERSION=$APP_VERSION
7070
before_script:
7171
- tests/setup.sh
7272
script:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ In order to run Behat tests for the mobile app, you need to install the [local_m
105105

106106
The Behat tests will be run against a container serving the mobile application, you have two options here:
107107

108-
1. Use a docker image that includes the application code. You need to specify the `MOODLE_APP_VERSION` env variable and the [moodlehq/moodleapp](https://hub.docker.com/r/moodlehq/moodleapp) image will be downloaded from docker hub.
108+
1. Use a docker image that includes the application code. You need to specify the `MOODLE_DOCKER_APP_VERSION` env variable and the [moodlehq/moodleapp](https://hub.docker.com/r/moodlehq/moodleapp) image will be downloaded from docker hub.
109109

110110
2. Use a local copy of the application code and serve it through docker, similar to how the Moodle site is being served. Set the `MOODLE_DOCKER_APP_PATH` env variable to the codebase in you file system. This will assume that you've already initialized the app calling `npm install` and `npm run setup` locally.
111111

@@ -179,7 +179,7 @@ You can change the configuration of the docker images by setting various environ
179179
| `MOODLE_DOCKER_WEB_PORT` | no | any integer value (or bind_ip:integer)| 127.0.0.1:8000| The port number for web. If set to 0, no port is used.<br/>If you want to bind to any host IP different from the default 127.0.0.1, you can specify it with the bind_ip:port format (0.0.0.0 means bind to all) |
180180
| `MOODLE_DOCKER_SELENIUM_VNC_PORT` | no | any integer value (or bind_ip:integer)| not set | If set, the selenium node will expose a vnc session on the port specified. Similar to MOODLE_DOCKER_WEB_PORT, you can optionally define the host IP to bind to. If you just set the port, VNC binds to 127.0.0.1 |
181181
| `MOODLE_DOCKER_APP_PATH` | no | path on your file system | not set | If set and the chrome browser is selected, it will start an instance of the Moodle app from your local codebase |
182-
| `MOODLE_APP_VERSION` | no | next, latest, or an app version number| not set | If set will start an instance of the Moodle app if the chrome browser is selected |
182+
| `MOODLE_DOCKER_APP_VERSION` | no | next, latest, or an app version number| not set | If set will start an instance of the Moodle app if the chrome browser is selected |
183183

184184
## Using XDebug for live debugging
185185

bin/moodle-docker-compose

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,23 @@ if [ -f $filename ]; then
4444
dockercompose="${dockercompose} -f ${filename}"
4545
fi
4646

47+
# Mobile app deprecated variables
48+
if [ ! -z "$MOODLE_APP_VERSION" ];
49+
then
50+
echo 'Warning: $MOODLE_APP_VERSION is deprecated, use $MOODLE_DOCKER_APP_VERSION instead'
51+
52+
if [ -z "$MOODLE_DOCKER_APP_VERSION" ];
53+
then
54+
export MOODLE_DOCKER_APP_VERSION="$MOODLE_APP_VERSION"
55+
fi
56+
fi
57+
4758
# Mobile app for development
4859
if [[ ! -z "$MOODLE_DOCKER_BROWSER" ]] && [[ "$MOODLE_DOCKER_BROWSER" == "chrome" ]] && [[ ! -z "$MOODLE_DOCKER_APP_PATH" ]];
4960
then
5061
dockercompose="${dockercompose} -f ${basedir}/moodle-app-dev.yml"
5162
# Mobile app using a docker image
52-
elif [[ ! -z "$MOODLE_DOCKER_BROWSER" ]] && [[ "$MOODLE_DOCKER_BROWSER" == "chrome" ]] && [[ ! -z "$MOODLE_APP_VERSION" ]];
63+
elif [[ ! -z "$MOODLE_DOCKER_BROWSER" ]] && [[ "$MOODLE_DOCKER_BROWSER" == "chrome" ]] && [[ ! -z "$MOODLE_DOCKER_APP_VERSION" ]];
5364
then
5465
dockercompose="${dockercompose} -f ${basedir}/moodle-app.yml"
5566
fi

bin/moodle-docker-compose.cmd

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,18 @@ if exist %filename% (
3434
SET DOCKERCOMPOSE=%DOCKERCOMPOSE% -f "%filename%"
3535
)
3636

37+
IF NOT "%MOODLE_APP_VERSION%"=="" (
38+
ECHO Warning: MOODLE_APP_VERSION is deprecated, use MOODLE_DOCKER_APP_VERSION instead
39+
40+
IF "%MOODLE_DOCKER_APP_VERSION%"=="" (
41+
SET MOODLE_DOCKER_APP_VERSION="%MOODLE_APP_VERSION%"
42+
)
43+
)
44+
3745
IF "%MOODLE_DOCKER_BROWSER%"=="chrome" (
3846
IF NOT "%MOODLE_DOCKER_APP_PATH%"=="" (
3947
SET DOCKERCOMPOSE=%DOCKERCOMPOSE% -f "%BASEDIR%\moodle-app-dev.yml"
40-
) ELSE IF NOT "%MOODLE_APP_VERSION%"=="" (
48+
) ELSE IF NOT "%MOODLE_DOCKER_APP_VERSION%"=="" (
4149
SET DOCKERCOMPOSE=%DOCKERCOMPOSE% -f "%BASEDIR%\moodle-app.yml"
4250
)
4351
)

bin/moodle-docker-wait-for-app

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -e
33

44
basedir="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"
55

6-
if [[ ! -z "$MOODLE_DOCKER_BROWSER" ]] && [[ "$MOODLE_DOCKER_BROWSER" == "chrome" ]] && ([[ ! -z "$MOODLE_DOCKER_APP_PATH" ]] || [[ ! -z "$MOODLE_APP_VERSION" ]]);
6+
if [[ ! -z "$MOODLE_DOCKER_BROWSER" ]] && [[ "$MOODLE_DOCKER_BROWSER" == "chrome" ]] && ([[ ! -z "$MOODLE_DOCKER_APP_PATH" ]] || [[ ! -z "$MOODLE_DOCKER_APP_VERSION" ]] || [[ ! -z "$MOODLE_APP_VERSION" ]]);
77
then
88
until $basedir/bin/moodle-docker-compose logs moodleapp | grep -q 'dev server running: ';
99
do

moodle-app.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ services:
44
environment:
55
MOODLE_DOCKER_APP: "true"
66
moodleapp:
7-
image: "moodlehq/moodleapp:${MOODLE_APP_VERSION}"
7+
image: "moodlehq/moodleapp:${MOODLE_DOCKER_APP_VERSION}"

0 commit comments

Comments
 (0)