diff --git a/.gitpod/setup-env.sh b/.gitpod/setup-env.sh index fd23d458..606eda01 100755 --- a/.gitpod/setup-env.sh +++ b/.gitpod/setup-env.sh @@ -8,8 +8,15 @@ then export MOODLE_BRANCH=main fi +if [ -z "$CLONEALL" ]; +then + FASTCLONE='--depth 1' +else + FASTCLONE="" +fi + # Clone Moodle repository. -cd "${GITPOD_REPO_ROOT}" && git clone --branch "${MOODLE_BRANCH}" --single-branch "${MOODLE_REPOSITORY}" moodle +cd "${GITPOD_REPO_ROOT}" && git clone ${FASTCLONE} --branch "${MOODLE_BRANCH}" --single-branch "${MOODLE_REPOSITORY}" moodle # Download the data file (if given). It will be used to generate some data. if [ -n "$DATAFILE" ]; diff --git a/README.md b/README.md index 730f4d4a..295f7ece 100644 --- a/README.md +++ b/README.md @@ -343,6 +343,7 @@ The Moodle Gitpod template supports the following environment variables: * `MOODLE_BRANCH`. The Moodle branch to be cloned. If left undefined, the default branch `main` is employed. * `DATAFILE`. When specified, this feature URL initializes the Moodle site with essential data. The value should be URL encoded. The content of this file adheres to the [Behat generators format](https://moodledev.io/general/development/tools/generator#create-a-testing-scenario-using-behat-generators) for creating testing scenarios. * `INSTALLADMINER`. Add this variable, set to any value, to install [adminer](https://www.adminer.org/). +* `CLONEALL`. If not set, a shallow clone is created, truncating the history to reduce the clone size. Set to `1` for a full clone. For a practical demonstration, launch a Gitpod workspace with the 'main' branch patch for [MDL-79912](https://tracker.moodle.org/browse/MDL-79912). Simply open the following URL in your web browser (note that MOODLE_REPOSITORY should be URL encoded). The password for the **admin** user is **test**: