100 lines
3.7 KiB
Bash
Executable File
100 lines
3.7 KiB
Bash
Executable File
#!/bin/bash
|
|
set -ex
|
|
|
|
version=5.64.0
|
|
LANG=nl_NL
|
|
|
|
|
|
# wp core download --version=$WP_VERSION
|
|
BASE_DIR=/usr/src/wordpress
|
|
cd $BASE_DIR
|
|
|
|
# Set config
|
|
if [ -e "wp-config.php" ]; then
|
|
cp wp-config-docker.php wp-config.php
|
|
fi
|
|
|
|
wp config shuffle-salts
|
|
wp config set DB_HOST "${WORDPRESS_DB_HOST}:3306"
|
|
wp config set DB_NAME "$WORDPRESS_DB_NAME"
|
|
wp config set DB_USER "$WORDPRESS_DB_USER"
|
|
wp config set DB_PASSWORD "$WORDPRESS_DB_PASSWORD"
|
|
wp config set CIVICRM_PLUGIN_DIR "${BASE_DIR}/wp-content/plugins/civicrm/"
|
|
wp config set CIVICRM_PLUGIN_URL "http://${WORDPRESS_HOST}/wp-content/plugins/civicrm/"
|
|
# Install
|
|
|
|
wp db check
|
|
wp core install --url="$WORDPRESS_HOST" --title="$WORDPRESS_NAME" --admin_user="$WORDPRESS_ADMIN_USER" --admin_password="$WORDPRESS_ADMIN_PASSWORD" --admin_email="$WORDPRESS_ADMIN_EMAIL" --locale=$LANG --skip-email
|
|
|
|
# Install CiviCRM
|
|
PLUGIN_DIR=${BASE_DIR}/wp-content/plugins
|
|
|
|
# Configure CivCRM
|
|
rm -f -- wp-content/uploads/civicrm/civicrm.settings.php
|
|
cv --no-interaction core:install -vv --setup-path=$PLUGIN_DIR/civicrm \
|
|
--src-path=$PLUGIN_DIR/civicrm/civicrm \
|
|
--user=www-data \
|
|
--cms-base-url="http://${WORDPRESS_HOST}" \
|
|
--lang=$LANG \
|
|
--db "mysql://$WORDPRESS_DB_USER:$WORDPRESS_DB_PASSWORD@$WORDPRESS_DB_HOST/$CIVI_DB_NAME"
|
|
|
|
wp plugin activate civicrm
|
|
cp wp-content/uploads/civicrm/civicrm.settings.php wp-content/uploads/civicrm/civicrm.settings.php.bak
|
|
|
|
cv upgrade:db
|
|
|
|
# Install extensions
|
|
cd ${BASE_DIR}/wp-content/uploads/civicrm/ext
|
|
|
|
# extensions
|
|
# built-in
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" org.civicrm.search_kit
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" org.civicrm.afform
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" org.civicrm.afform_admin
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" civigrant
|
|
# migration
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" de.systopia.identitytracker
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" org.project60.banking
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" action-provider
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" form-processor
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" de.systopia.xcm
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" bij1algemeen
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" bij1migratie
|
|
# misc
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" assignee
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" apikey
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" dataprocessor
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" emailapi
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" group2summary
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" org.project60.bic
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" org.project60.sepa
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" org.civicrm.contactlayout
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" org.civicrm.recentmenu
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" civirules
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" bij1rules
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" org.wikimedia.relationshipblock
|
|
cv ext:enable --user="$WORDPRESS_ADMIN_USER" uk.co.vedaconsulting.mosaico
|
|
|
|
cv ext:upgrade-db --user="$WORDPRESS_ADMIN_USER"
|
|
|
|
cd ${BASE_DIR}
|
|
wp plugin install --activate civicrm-admin-utilities wpforms-lite wp-2fa
|
|
|
|
# remove unused
|
|
wp plugin delete akismet hello
|
|
|
|
# bug in installer?
|
|
# move to upgrade/post-install:
|
|
# sed -i -e 's,http://testcrm,https://testcrm,' ${BASE_DIR}/wp-content/uploads/civicrm/civicrm.settings.php
|
|
# cat >> ${BASE_DIR}/wp-content/uploads/civicrm/civicrm.settings.php << EOF
|
|
# // Disable automatic download / installation of extensions
|
|
# $civicrm_setting['domain']['ext_repo_url'] = false;
|
|
# $civicrm_setting['domain']['enableSSL'] = true;
|
|
# EOF
|
|
|
|
# make immutable
|
|
wp config set DISALLOW_FILE_MODS "true"
|
|
wp config set AUTOMATIC_UPDATER_DISABLED "true"
|
|
|
|
echo "DONE!"
|