Skip to content

Commit

Permalink
Issue LionsAd#38: Revert phpunit-core runner to require installed Dru…
Browse files Browse the repository at this point in the history
…pal again.
  • Loading branch information
yanniboi committed Jan 23, 2017
1 parent cfe551b commit f6806e3
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 20 deletions.
5 changes: 0 additions & 5 deletions environments/drupal-7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ function drupal_ti_download_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 "$DRUPAL_TI_INSTALL_PROFILE" --db-url="$DRUPAL_TI_DB_URL"
drush use $(pwd)#default
}
Expand Down
4 changes: 0 additions & 4 deletions environments/drupal-8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ function drupal_ti_download_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 "$DRUPAL_TI_INSTALL_PROFILE" --db-url="$DRUPAL_TI_DB_URL"
drush use $(pwd)#default
}
Expand Down
20 changes: 14 additions & 6 deletions functions/drupal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Common functionality for common tasks.

#
# Ensures that the right Drupal version exists.
# Ensures that the right Drupal version is downloaded.
#
function drupal_ti_ensure_drupal() {
function drupal_ti_ensure_drupal_download() {
# This function is re-entrant.
if [ -d "$DRUPAL_TI_DRUPAL_DIR" ]
then
Expand All @@ -30,16 +30,24 @@ function drupal_ti_ensure_drupal() {
}

#
# Ensures that Drupal is installed.
# Ensures that the right Drupal version is installed.
#
function drupal_ti_ensure_drupal_installed() {
drupal_ti_ensure_drupal
function drupal_ti_ensure_drupal() {
# This function is re-entrant.
drupal_ti_ensure_drupal_download

# @todo Maybe use a different check for Drupal installed.
if [ -r "$TRAVIS_BUILD_DIR/../drupal_ti-drupal-installed" ]
then
return
fi

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

cd drupal
cd "$DRUPAL_TI_DRUPAL_DIR"
drupal_ti_install_drupal
touch "$TRAVIS_BUILD_DIR/../drupal_ti-drupal-installed"
}

#
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_installed
drupal_ti_ensure_drupal

# Ensure the module is linked into the code base and enabled.
drupal_ti_ensure_module
Expand Down
3 changes: 0 additions & 3 deletions runners/phpunit-core/before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ set -e $DRUPAL_TI_DEBUG
# Ensure the right Drupal version is downloaded.
drupal_ti_ensure_drupal

# Change directory to Drupal core directory.
cd drupal

# Ensure the module is linked into the code base.
drupal_ti_ensure_module_linked

Expand Down
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_installed
drupal_ti_ensure_drupal

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

0 comments on commit f6806e3

Please sign in to comment.