Skip to content

Commit

Permalink
Merge pull request #735 from civicrm/drupal_clean_install_cv
Browse files Browse the repository at this point in the history
drupal-clean, drupal-demo - Switch to civicrm_install_cv
  • Loading branch information
totten authored Dec 10, 2022
2 parents 3bb3035 + 3c85447 commit 27efbfb
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 6 deletions.
3 changes: 3 additions & 0 deletions app/config/drupal-clean/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ pushd "$WEB_ROOT/web"

extract-url --cache-ttl 172800 civicrm=http://download.civicrm.org/civicrm-l10n-core/archives/civicrm-l10n-daily.tar.gz
## or https://raw.github.com/civicrm/l10n/master/po/fr_CA/civicrm.mo => civicrm/l10n/fr_CA/LC_MESSAGES/
pushd civicrm
composer install
popd
popd

popd
12 changes: 11 additions & 1 deletion app/config/drupal-clean/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,17 @@ if [[ "$CIVI_VERSION" =~ ^4.[0123456](\.([0-9]|alpha|beta)+)?$ ]] ; then
CIVI_EXT_URL="${CMS_URL}/sites/${DRUPAL_SITE_DIR}/ext"
fi

civicrm_install
# If you've switched branches and triggered `reinstall`, then you need to refresh composer deps/autoloader before installing
(cd "$CIVI_CORE" && composer install)

civicrm_install_cv

## Generating `civicrm.config.php` is necessary for `extern/*.php` and its E2E tests
(cd "$CIVI_CORE" && ./bin/setup.sh -g)

###############################################################################
## Extra configuration

pushd "${CMS_ROOT}/sites/${DRUPAL_SITE_DIR}" >> /dev/null

drush -y updatedb
Expand All @@ -48,6 +55,9 @@ pushd "${CMS_ROOT}/sites/${DRUPAL_SITE_DIR}" >> /dev/null

cv ev 'if(is_callable(array("CRM_Core_BAO_CMSUser","synchronize"))){CRM_Core_BAO_CMSUser::synchronize(FALSE);}else{CRM_Utils_System::synchronizeUsers();}'

## Setup CiviCRM
cv vset '{"enable_components":["CiviEvent","CiviContribute","CiviMember","CiviMail","CiviReport","CiviPledge","CiviCase","CiviCampaign"]}'

## Setup theme
#above# drush -y en garland
export SITE_CONFIG_DIR
Expand Down
3 changes: 3 additions & 0 deletions app/config/drupal-demo/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ pushd "$WEB_ROOT/web"
git clone "${CACHE_DIR}/civicrm/org.civicrm.contactlayout.git" -b "master" civicrm/tools/extensions/org.civicrm.contactlayout
extract-url --cache-ttl 172800 civicrm=http://download.civicrm.org/civicrm-l10n-core/archives/civicrm-l10n-daily.tar.gz
## or https://raw.github.com/civicrm/l10n/master/po/fr_CA/civicrm.mo => civicrm/l10n/fr_CA/LC_MESSAGES/
pushd civicrm
composer install
popd
popd

popd
16 changes: 11 additions & 5 deletions app/config/drupal-demo/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,18 @@ if [[ "$CIVI_VERSION" =~ ^4.[0123456](\.([0-9]|alpha|beta)+)?$ ]] ; then
CIVI_EXT_URL="${CMS_URL}/sites/${DRUPAL_SITE_DIR}/ext"
fi

civicrm_install

# If you've switched branches and triggered `reinstall`, then you need to refresh composer deps/autoloader before installing
(cd "$CIVI_CORE" && composer install)

civicrm_install_cv

## Generating `civicrm.config.php` is necessary for `extern/*.php` and its E2E tests
(cd "$CIVI_CORE" && ./bin/setup.sh -g)

###############################################################################
## Extra configuration

pushd "${CMS_ROOT}/sites/${DRUPAL_SITE_DIR}" >> /dev/null

drush -y updatedb
Expand All @@ -49,11 +57,9 @@ pushd "${CMS_ROOT}/sites/${DRUPAL_SITE_DIR}" >> /dev/null

## Setup CiviCRM
if cv ev 'exit(version_compare(CRM_Utils_System::version(), "5.47.alpha", "<") ?0:1);' ; then
echo '{"enable_components":["CiviEvent","CiviContribute","CiviMember","CiviMail","CiviReport","CiviPledge","CiviCase","CiviCampaign","CiviGrant"]}' \
| drush cvapi setting.create --in=json
cv vset '{"enable_components":["CiviEvent","CiviContribute","CiviMember","CiviMail","CiviReport","CiviPledge","CiviCase","CiviCampaign","CiviGrant"]}'
else
echo '{"enable_components":["CiviEvent","CiviContribute","CiviMember","CiviMail","CiviReport","CiviPledge","CiviCase","CiviCampaign"]}' \
| drush cvapi setting.create --in=json
cv vset '{"enable_components":["CiviEvent","CiviContribute","CiviMember","CiviMail","CiviReport","CiviPledge","CiviCase","CiviCampaign"]}'
fi
## Note: CiviGrant disabled by default. If you enable, update the permissions as well.
civicrm_apply_demo_defaults
Expand Down
5 changes: 5 additions & 0 deletions bin/civi-test-run
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function task_phpunit() {

if [ $SUITE = 'E2E_AllTests' ]; then
$GUARD civibuild restore "$BLDNAME"
$GUARD cv flush --cwd="$CIVI_CORE" ## This is smelly. It begs the question of "what is leaking between tests".
fi

$GUARD phpunit-xml-cleanup "$JUNITDIR"/*.xml
Expand Down Expand Up @@ -151,6 +152,7 @@ function test_core_extenions() {
elif [ -f "$DIR/phpunit.xml.dist" ]; then
task_phpunit_core_extension "$(basename $DIR)"
$GUARD civibuild restore "$BLDNAME"
$GUARD cv flush --cwd="$CIVI_CORE" ## This is smelly. It begs the question of "what is leaking between tests".
fi
done
}
Expand All @@ -160,10 +162,12 @@ function test_afform_extensions() {
pushd "$DIR"
task_phpunit_core_extension "$(basename $DIR)/core" "afform-core"
$GUARD civibuild restore "$BLDNAME"
$GUARD cv flush --cwd="$CIVI_CORE" ## This is smelly. It begs the question of "what is leaking between tests".
cv en afform
cv en --ignore-missing authx
task_phpunit_core_extension "$(basename $DIR)/mock" "afform-mock"
$GUARD civibuild restore "$BLDNAME"
$GUARD cv flush --cwd="$CIVI_CORE" ## This is smelly. It begs the question of "what is leaking between tests".
popd
}

Expand Down Expand Up @@ -200,6 +204,7 @@ function task_upgrade() {
fi

$GUARD civibuild restore "$BLDNAME"
$GUARD cv flush --cwd="$CIVI_CORE" ## This is smelly. It begs the question of "what is leaking between tests".
}

## Execute the upgrade test suite (via 'civicrm-upgrade-test' bash script).
Expand Down

0 comments on commit 27efbfb

Please sign in to comment.