Skip to content

Commit

Permalink
Issue LionsAd#38: Decouple download and installation of Drupal core a…
Browse files Browse the repository at this point in the history
…nd modules.
  • Loading branch information
mradcliffe committed Aug 8, 2015
1 parent 0d25ea9 commit aeb0e05
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 13 deletions.
11 changes: 9 additions & 2 deletions environments/drupal-7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
# @file
# Drupal-7 environment variables and functions.

function drupal_ti_install_drupal() {
function drupal_ti_download_drupal() {
drush --yes dl drupal-7 --drupal-project-rename=drupal
cd drupal
}

function drupal_ti_install_drupal() {
if [ ! -f install.php ]
then
return -1
fi

php -d sendmail_path=$(which true) ~/.composer/vendor/bin/drush.php --yes site-install testing --db-url="$DRUPAL_TI_DB_URL"
drush use $(pwd)#default
}
Expand Down
10 changes: 8 additions & 2 deletions environments/drupal-8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
# @file
# Drupal-8 environment variables and functions.

function drupal_ti_install_drupal() {
function drupal_ti_download_drupal() {
git clone --depth 1 --branch 8.0.x http://git.drupal.org/project/drupal.git
cd drupal
}

function drupal_ti_install_drupal() {
if [ ! -f install.php ]
then
return -1
fi
php -d sendmail_path=$(which true) ~/.composer/vendor/bin/drush.php --yes -v site-install minimal --db-url="$DRUPAL_TI_DB_URL"
drush use $(pwd)#default
}
Expand Down
18 changes: 14 additions & 4 deletions functions/drupal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Common functionality for common tasks.

#
# Ensures that the right Drupal version is installed.
# Ensures that the right Drupal version exists.
#
function drupal_ti_ensure_drupal() {
# This function is re-entrant.
Expand All @@ -23,12 +23,22 @@ function drupal_ti_ensure_drupal() {
export PATH="$BIN_DIR:$PATH"
fi

# Create database and install Drupal.
mysql -e "create database $DRUPAL_TI_DB"

mkdir -p "$DRUPAL_TI_DRUPAL_BASE"
cd "$DRUPAL_TI_DRUPAL_BASE"

drupal_ti_download_drupal
}

#
# Ensures that Drupal is installed.
#
function drupal_ti_ensure_drupal_installed() {
drupal_ti_ensure_drupal

# Create database and install Drupal.
mysql -e "create database $DRUPAL_TI_DB"

cd drupal
drupal_ti_install_drupal
}

Expand Down
2 changes: 1 addition & 1 deletion runners/behat/before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
set -e $DRUPAL_TI_DEBUG

# Ensure the right Drupal version is installed.
drupal_ti_ensure_drupal
drupal_ti_ensure_drupal_installed

# Ensure the module is linked into the code base and enabled.
drupal_ti_ensure_module
Expand Down
6 changes: 3 additions & 3 deletions runners/phpunit-core/before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

set -e $DRUPAL_TI_DEBUG

# Ensure the right Drupal version is installed.
# Ensure the right Drupal version is downloaded.
drupal_ti_ensure_drupal

# Ensure the module is linked into the code base and enabled.
drupal_ti_ensure_module
# Ensure the module is linked into the code base.
drupal_ti_ensure_module_linked
2 changes: 1 addition & 1 deletion runners/simpletest/before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
set -e $DRUPAL_TI_DEBUG

# Ensure the right Drupal version is installed.
drupal_ti_ensure_drupal
drupal_ti_ensure_drupal_installed

# Enable simpletest module.
cd "$DRUPAL_TI_DRUPAL_DIR"
Expand Down

0 comments on commit aeb0e05

Please sign in to comment.