Compare commits

...

2 Commits
main ... doemee

Author SHA1 Message Date
Kiara Grouwstra 5b08cc360b handle premium extensions 2023-10-17 00:12:10 +02:00
Kiara Grouwstra 781d0f9d5b doemee 2023-10-16 23:30:59 +02:00
2 changed files with 50 additions and 35 deletions

View File

@ -4,7 +4,7 @@ This script automates installing Wordpress with all specific BIJ1 plugins,
template and Advanced Custom Fields settings.
Steps:
- install `php` and `php-mysql`
- install `zip`, `unzip`, `php` and `php-mysql`
- First you have to setup a database on the db server, e.g. for MariaDB/MySQL (substituting `$WORDPRESS_DB_USER`, `$db`, `$password`, `$server`):
- ```sql
CREATE USER '$WORDPRESS_DB_USER'@'$server.internal.bij1.net' IDENTIFIED BY '$password';

View File

@ -59,22 +59,10 @@ printf '%s\n' "g/$STRING/d" a "$SALT" . w | ed -s wp-config.php
# Convert Windows line endings to *nix style
sed -i '' 's/\r//g' wp-config.php
export BIJ1_SETTINGS="
define( 'LOGO_BIG_PATH', '/wp-content/themes/BIJ1/img/afdelingen/arnhem-nijmegen-breed.svg' );
define( 'LOGO_SMALL_PATH', '/wp-content/themes/BIJ1/img/afdelingen/arnhem-nijmegen.svg' );
define( 'IS_MAIN_SITE', false);
"
# Add custom BIJ1 settings to wp-config in the "custom values" block
perl -0777 -pe 's/(.*custom values[^\n]*)/$1\n$ENV{BIJ1_SETTINGS}/s' wp-config.php > wp-config-new.php
rm wp-config.php
mv wp-config-new.php wp-config.php
# Setup template
git clone https://code.bij1.org/bij1/bij1-wp-theme.git tmp
git clone https://code.bij1.org/bij1/wp-theme-simple-campaign.git tmp
rm -rf wp-content/themes/twenty*
mv tmp/src wp-content/themes/BIJ1
mv tmp/src wp-content/themes/simple-campaign
rm -rf tmp/
echo "Installing Wordpress, please note down the password"
@ -83,25 +71,52 @@ echo -e "\n\n\n"
echo "Installing plugins"
./wp plugin install acf.zip --activate --allow-root > /dev/null
./wp plugin install acf-options-for-polylang --activate --allow-root > /dev/null
./wp plugin install admin-menu-editor --activate --allow-root > /dev/null
./wp plugin install advanced-custom-fields-pro --activate --allow-root > /dev/null
./wp plugin install ajax-load-more --activate --allow-root > /dev/null
./wp plugin install gosign-gallery-box-block --activate --allow-root > /dev/null
./wp plugin install polylang --activate --allow-root > /dev/null
./wp plugin install simple-custom-post-order --activate --allow-root > /dev/null
./wp plugin install ics-calendar --activate --allow-root > /dev/null
./wp plugin install easy-wp-smtp --activate --allow-root
./wp plugin install opengraph --activate --allow-root
function install_zipped_ext {
# work-around for timeout issues during download
echo "install_zipped_ext $@"
name="$1"
url="$2"
filename=$(mktemp)
curl -L --output $filename $url
unzip -q $filename
dirname=$(find -maxdepth 1 -name "${name}*" -type d)
dirname=$(basename $dirname)
[ "$dirname" = "$name" ] || mv -v $dirname $name
zip -r $name.zip $name
./wp plugin install $name.zip --activate --allow-root
}
./wp plugin install advanced-custom-fields --activate --allow-root
# ./wp plugin install acf.zip --activate --allow-root
# ./wp plugin install https://gitlab.com/wordpress-premium/advanced-custom-fields-pro/-/archive/v6.2.0/advanced-custom-fields-pro-v6.2.0.zip --activate --allow-root
./wp plugin install add-on-cf7-for-airtable --activate --allow-root
./wp plugin install cf7-to-zapier --activate --allow-root
./wp plugin install coming-soon --activate --allow-root
./wp plugin install cf7-conditional-fields --activate --allow-root
./wp plugin install contact-form-7 --activate --allow-root
./wp plugin install contact-form-7-dynamic-text-extension --activate --allow-root
./wp plugin install contact-form-7-civicrm-integration --activate --allow-root
./wp plugin install wp-gdpr-compliance --activate --allow-root
./wp plugin install doneren-met-mollie --activate --allow-root
./wp plugin install doi-helper --activate --allow-root
./wp plugin install email-verification-for-contact-form-7 --activate --allow-root
./wp plugin install https://github.com/pronamic/gravityforms/releases/download/2.7.15/gravityforms-2.7.15.zip --activate --allow-root
./wp plugin install https://github.com/pronamic/wp-gravityforms-nl/releases/download/v3.0.7/gravityforms-nl.3.0.7.zip --activate --allow-root
./wp plugin install header-footer --activate --allow-root
./wp plugin install pronamic-ideal --activate --allow-root # https://github.com/pronamic/wp-pronamic-pay
./wp plugin install pronamic-pay-with-mollie-for-contact-form-7 --activate --allow-root
./wp plugin install wp-2fa --activate --allow-root
./wp plugin install wp-crontrol --activate --allow-root
./wp plugin install wordpress-seo --activate --allow-root
# ./wp plugin install gravityformsgutenberg --activate --allow-root
install_zipped_ext gravityformsmailchimp https://github.com/wp-premium/gravityformsmailchimp/archive/refs/tags/2.4.5.zip
install_zipped_ext gravityformswebhooks https://github.com/wp-premium/gravityformswebhooks/archive/refs/tags/1.4.zip
install_zipped_ext gravityformszapier https://github.com/wp-premium/gravityformszapier/archive/refs/tags/3.3.zip
echo "Activate BIJ1 theme"
./wp theme activate BIJ1 --allow-root
echo "Create menus"
./wp menu create "Header menu" --allow-root
./wp menu create "Informatie" --allow-root
./wp menu create "Kom in actie" --allow-root
./wp menu create "Language" --allow-root
./wp menu create "Main" --allow-root
./wp menu create "Secondary" --allow-root
./wp theme activate simple-campaign --allow-root