Skip to content

Instantly share code, notes, and snippets.

@bbrala
Created December 7, 2021 23:00
Show Gist options
  • Save bbrala/f3de3b198a86e94b29632f25bde48afb to your computer and use it in GitHub Desktop.
Save bbrala/f3de3b198a86e94b29632f25bde48afb to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
VERSION=${1:-9.4.x}
cd /home/localcopy
sudo chmod 777 -R drupal-core
rm -rf drupal-core-${VERSION//./-}
mkdir drupal-core-${VERSION//./-}
cd drupal-core-${VERSION//./-}
git clone -b ${VERSION} [email protected]:project/drupal web
cd web
composer i
composer require --dev drupal/core-dev
composer require --dev phpspec/prophecy-phpunit:^2 -W
composer require --dev drush/drush
cp sites/example.settings.local.php sites/default/settings.local.php
drush --yes site:install standard \
install_configure_form.site_default_country=NL \
install_configure_form.date_default_timezone=Europe/Amsterdam \
install_configure_form.enable_update_status_module=1 \
install_configure_form.enable_update_status_emails=NULL \
--locale="en" \
--site-name="core workspace" \
--site-mail="[email protected]" \
--account-name="root" \
--account-pass="root" \
--account-mail="[email protected]" \
-db-url="mysql://root:root@localhost/drupal_core_${VERSION//./-}"
cd ..
ln -s web public_html
cp web/core/phpunit.xml.dist web/core/phpunit.xml
mkdir -p web/sites/simpletest/browser_output
chmod -R 777 web/sites/simpletest
sed -i 's|name="SIMPLETEST_BASE_URL" value=""|name="SIMPLETEST_BASE_URL" value="https://drupal-core-${VERSION//./-}\.dev\.swis\.nl"|g' web/core/phpunit.xml
sed -i 's|name="SIMPLETEST_DB" value=""|name="SIMPLETEST_DB" value="mysql://root:root@localhost/drupal_core_${VERSION//./-}"|g' web/core/phpunit.xml
sed -i 's|name="BROWSERTEST_OUTPUT_DIRECTORY" value=""|name="BROWSERTEST_OUTPUT_DIRECTORY" value="../sites/simpletest/browser_output"|g' web/core/phpunit.xml
sed -i 's|<!-- <env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled"/> -->|<env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled"/>|g' web/core/phpunit.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment