provision_container: Refactor installation order

This commit updates the order in which modules are installed and enabled
during installation to make the provisioning script simpler.
This commit is contained in:
Tom Wiesing 2022-07-13 13:50:34 +02:00
parent f8c18d8d83
commit eee3d95351
No known key found for this signature in database

View file

@ -58,10 +58,31 @@ log_info " => Creating '$COMPOSER_DIR'"
mkdir -p "$COMPOSER_DIR" mkdir -p "$COMPOSER_DIR"
cd "$COMPOSER_DIR" cd "$COMPOSER_DIR"
# workaround for making the drupal sites directory writable
function drupal_sites_permission_workaround() { function drupal_sites_permission_workaround() {
chmod -R u+w "$WEB_DIR/sites/" || true chmod -R u+w "$WEB_DIR/sites/" || true
} }
# install a module with composer and enable it with drush
# Example:
#
# composer_install_and_enable << EOF
# drupal/some_module:1.23 some_module
# drupal/other_module:2.34
# EOF
#
# Will install both modules, but only enable the first one.
function composer_install_and_enable() {
while IFS= read -r line; do
echo "$line" | (
read composer drush;
drupal_sites_permission_workaround
composer require "$composer"
[ -n "$drush" ] && drush pm-enable --yes "$drush"
)
done
}
# Create a new composer project. # Create a new composer project.
log_info " => Creating composer project" log_info " => Creating composer project"
@ -113,38 +134,22 @@ if [ -f "$EASYRDF_RESPONSE" ]; then
fi fi
popd popd
drupal_sites_permission_workaround
composer require 'drupal/inline_entity_form:^1.0@RC'
drupal_sites_permission_workaround
composer require drupal/imagemagick
drupal_sites_permission_workaround
composer require drupal/image_effects
drupal_sites_permission_workaround
composer require drupal/colorbox
log_info " => Enable Wisski modules"
drush pm-enable --yes wisski_core wisski_linkblock wisski_pathbuilder wisski_adapter_sparql11_pb wisski_salz
drupal_sites_permission_workaround
log_info " => Installing and enabling additional modules" log_info " => Installing and enabling additional modules"
composer_install_and_enable << EOF
while IFS= read -r line; do drupal/inline_entity_form:^1.0@RC
echo "$line" | ( drupal/imagemagick
read composer drush; drupal/image_effects
drupal_sites_permission_workaround drupal/colorbox
composer require "$composer"
drush pm-enable --yes "$drush"
)
done << EOF
drupal/devel:^4.1 devel drupal/devel:^4.1 devel
drupal/geofield:^1.40 geofield drupal/geofield:^1.40 geofield
drupal/geofield_map:^2.85 geofield_map drupal/geofield_map:^2.85 geofield_map
drupal/imce:^2.4 imce drupal/imce:^2.4 imce
EOF EOF
log_info " => Enable Wisski modules"
drush pm-enable --yes wisski_core wisski_linkblock wisski_pathbuilder wisski_adapter_sparql11_pb wisski_salz
drupal_sites_permission_workaround
log_info " => Setting up WissKI Salz Adapter" log_info " => Setting up WissKI Salz Adapter"
drush php:script /wisskiutils/create_adapter.php "$INSTANCE_DOMAIN" "$GRAPHDB_REPO" "$GRAPHDB_HEADER" drush php:script /wisskiutils/create_adapter.php "$INSTANCE_DOMAIN" "$GRAPHDB_REPO" "$GRAPHDB_HEADER"