diff options
Diffstat (limited to 'share/templater/drupal-composer/setup')
-rwxr-xr-x | share/templater/drupal-composer/setup | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/share/templater/drupal-composer/setup b/share/templater/drupal-composer/setup new file mode 100755 index 0000000..4b82243 --- /dev/null +++ b/share/templater/drupal-composer/setup @@ -0,0 +1,77 @@ +#!/bin/bash +# +# Basic files templater module. +# + +# Parameters +SHARE="$1" + +# Include basic functions +source $SHARE/templater/functions || exit 1 + +# Drupal8 implementation +function templater_drupal8 { + if [ ! -e 'settings.php' ]; then + templater_echo "Setting up Drupal 8..." + + if [ ! -e ".gitignore" ] || ! grep -q "^settings.php" .gitignore; then + echo web/sites/default/settings.php >> .gitignore + echo web/sites/default/settings.local.php >> .gitignore + echo web/sites/default/settings.prod.php >> .gitignore + echo web/sites/default/services.yml >> .gitignore + echo web/sites/default/files >> .gitignore + echo sql >> .gitignore + fi + + mkdir -p web/sites/default + + if [ ! -e "settings.dev.php" ]; then + cp $SHARE/drupal8/files/default.settings.php web/sites/default/settings.dev.php + #cp $SHARE/drupal8/files/default.settings.php . + fi + + ln -sf settings.dev.php settings.php + + if [ ! -e "settings.local.php" ]; then + cp $SHARE/drupal7/files/settings.local.php web/sites/default/settings.local.php + fi + + if [ ! -e "services.yml" ]; then + cp $SHARE/drupal8/files/default.services.yml web/sites/default/services.dev.yml + #cp $SHARE/drupal8/files/default.services.yml . + fi + + ln -sf services.dev.yml services.yml + + templater_install_makefile $SHARE/drupal8/files/Makefile.drupal-composer + + if [ ! -e "drupal.make.yml" ]; then + cp $SHARE/drupal8/files/drupal.make.yml . + fi + + if [ ! -e "README.drupal-composer.md" ]; then + cp $SHARE/drupal8/files/README.drupal-composer.md . + fi + + if [ -d "puppet" ] && [ ! -e "puppet/Puppetfile" ]; then + cp $SHARE/drupal8/files/puppet/Puppetfile puppet/ + else + cp $SHARE/drupal8/files/puppet/Puppetfile puppet/Puppetfile.drupal-composer + fi + + # Use pushtodeploy instead + #if [ ! -e "bin/post-receive" ]; then + # mkdir -p bin && cp $SHARE/drupal8/files/bin/post-receive bin/ + #fi + templater_echo "Please use pushtodeploy module for automatede deploymends" + + mkdir -p files config/sync themes modules libraries vendor + touch {files,config/sync,themes,modules,libraries,vendor}/.empty + git add -f {files,config/sync,themes,modules,libraries}/.empty + else + templater_echo "Drupal already set" + fi +} + +# Dispatch +templater_drupal8 |