Skip to content
Snippets Groups Projects
Commit 136e6bc2 authored by Travis Carden's avatar Travis Carden Committed by Adam G-H
Browse files

Issue #3306600 by TravisCarden, phenaproxima, rahul_: Speed up setup_local_dev.sh Drupal core clone

parent 25d3dcd5
No related branches found
No related tags found
No related merge requests found
......@@ -40,10 +40,18 @@ Several details of your setup can be customized via environment variables. Set t
```shell
DRUPAL_CORE_BRANCH="9.5.x" # The branch of Drupal core that will be installed.
DRUPAL_CORE_SHALLOW_CLONE="TRUE" # Whether or not to do a "shallow clone" of Drupal core. (Defaults to TRUE.) See note below.
AUTOMATIC_UPDATES_BRANCH="8.x-2.x" # The branch of the Automatic Updates module that will be installed.
SITE_DIRECTORY="auto-updates-dev" # The path to the directory where the dev environment will be installed.
```
Note: A shallow Git clone is much smaller and therefore faster, but it removes the ability to do debugging operations such as `git bisect` or `git blame`. To recover these abilities, [you can convert your repository to a full clone after the fact](https://stackoverflow.com/questions/6802145/how-to-convert-a-git-shallow-clone-to-a-full-clone):
```shell
cd auto-updates-dev
git fetch --unshallow
```
### Alternative setup options
You can download the setup script first to review its contents or modify it before running it:
......
......@@ -16,6 +16,7 @@
# your terminal session) to override their default values.
# @see https://www.serverlab.ca/tutorials/linux/administration-linux/how-to-set-environment-variables-in-linux/
DRUPAL_CORE_BRANCH=${DRUPAL_CORE_BRANCH:="9.5.x"}
DRUPAL_CORE_SHALLOW_CLONE=${DRUPAL_CORE_SHALLOW_CLONE:="TRUE"}
AUTOMATIC_UPDATES_BRANCH=${AUTOMATIC_UPDATES_BRANCH:="8.x-2.x"}
SITE_DIRECTORY=${SITE_DIRECTORY:="auto_updates_dev"}
SITE_HOST=${SITE_HOST:="$SITE_DIRECTORY.test"}
......@@ -49,7 +50,7 @@ fi
# Prompt for confirmation.
cat << WARNING
You are about to create an Automatic Updates development environment at "$SITE_DIRECTORY". This will download
as much as 400 MB of data and take approximately one minute to complete, depending on your Internet connection.
as much as 100 MB of data and may take several minutes to complete, depending on your Internet connection.
WARNING
read -p "Do you want to continue? [yN] " -n 1 -r
......@@ -61,9 +62,13 @@ fi
echo
# Clone Drupal core.
if [[ "$DRUPAL_CORE_SHALLOW_CLONE" == "TRUE" ]]; then
DRUPAL_CORE_CLONE_DEPTH="--depth 1"
fi
git clone \
https://git.drupalcode.org/project/drupal.git \
--branch "$DRUPAL_CORE_BRANCH" \
$DRUPAL_CORE_CLONE_DEPTH \
"$SITE_DIRECTORY"
cd "$SITE_DIRECTORY" || exit 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment