Skip to content

Commit

Permalink
Merge pull request #750 from totten/master-installer
Browse files Browse the repository at this point in the history
drupal-* - Use 'civicrm_install_transitional'
  • Loading branch information
totten authored Jan 3, 2023
2 parents 175eea6 + 196cb18 commit 83f04db
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 18 deletions.
2 changes: 1 addition & 1 deletion app/config/drupal-case/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ CIVI_FILES="${CMS_ROOT}/sites/${DRUPAL_SITE_DIR}/files/civicrm"
CIVI_TEMPLATEC="${CIVI_FILES}/templates_c"
CIVI_UF="Drupal"

civicrm_install
civicrm_install_transitional

###############################################################################
## Extra configuration
Expand Down
8 changes: 1 addition & 7 deletions app/config/drupal-clean/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,7 @@ if [[ "$CIVI_VERSION" =~ ^4.[0123456](\.([0-9]|alpha|beta)+)?$ ]] ; then
CIVI_EXT_URL="${CMS_URL}/sites/${DRUPAL_SITE_DIR}/ext"
fi

# 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)
civicrm_install_transitional

###############################################################################
## Extra configuration
Expand Down
9 changes: 1 addition & 8 deletions app/config/drupal-demo/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,7 @@ if [[ "$CIVI_VERSION" =~ ^4.[0123456](\.([0-9]|alpha|beta)+)?$ ]] ; then
CIVI_EXT_URL="${CMS_URL}/sites/${DRUPAL_SITE_DIR}/ext"
fi


# 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)
civicrm_install_transitional

###############################################################################
## Extra configuration
Expand Down
2 changes: 1 addition & 1 deletion app/config/drupal-sym1/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if [[ "$CIVI_VERSION" =~ ^4.[0123456](\.([0-9]|alpha|beta)+)?$ ]] ; then
CIVI_EXT_URL="${CMS_URL}/sites/${DRUPAL_SITE_DIR}/ext"
fi

civicrm_install
civicrm_install_transitional

###############################################################################
## Extra configuration
Expand Down
2 changes: 1 addition & 1 deletion app/config/drupal-sym2/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if [[ "$CIVI_VERSION" =~ ^4.[0123456](\.([0-9]|alpha|beta)+)?$ ]] ; then
CIVI_EXT_URL="${CMS_URL}/sites/${DRUPAL_SITE_DIR}/ext"
fi

civicrm_install
civicrm_install_transitional

###############################################################################
## Extra configuration
Expand Down
36 changes: 36 additions & 0 deletions src/civibuild.lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,28 @@ function civicrm_install() {
civicrm_update_domain
}

###############################################################################
## Generate config files and setup database. (Use either newer or older installer, depending on version).
function civicrm_install_transitional() {
cvutil_assertvars civicrm_install CIVI_CORE

## If installing an older version, provide continuity (for purposes of test matrices/contrib tests/etc).
if civicrm_check_ver '<' 5.57.alpha1 ; then

civicrm_install

## Newer versions should use 'cv core:install' to match regular web-installer
else
# 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)
fi
}

###############################################################################
## Generate config files and setup database (via cv)
function civicrm_install_cv() {
Expand Down Expand Up @@ -924,6 +946,20 @@ function civicrm_get_ver() {
popd >> /dev/null
}

###############################################################################
## Check if the civicrm matches some condition
## usage: civicrm_check_ver <op> <target>
## example: if civicrm_check_ver '>=' '5.43' ; then echo NEW; else echo OLD; fi
function civicrm_check_ver() {
cvutil_assertvars civicrm_check_ver CIVI_CORE
local ver=$( civicrm_get_ver "$CIVI_CORE" )
if env ACTUAL="$ver" OP="$1" EXPECT="$2" php -r 'exit(version_compare(getenv("ACTUAL"), getenv("EXPECT"), getenv("OP"))?0:1);'; then
return 0
else
return 1
fi
}

###############################################################################
## usage: civicrm_ext_download_bare <key> <path>
function civicrm_ext_download_bare() {
Expand Down

0 comments on commit 83f04db

Please sign in to comment.