#!/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 settings.php >> .gitignore echo settings.local.php >> .gitignore echo settings.prod.php >> .gitignore echo services.yml >> .gitignore echo files >> .gitignore echo sql >> .gitignore fi if [ ! -e "settings.dev.php" ]; then cp $SHARE/drupal8/files/default.settings.php 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/drupal8/files/settings.local.php settings.local.php fi if [ ! -e "services.yml" ]; then cp $SHARE/drupal8/files/default.services.yml 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.drupal8 if [ ! -e "drupal.make.yml" ]; then cp $SHARE/drupal8/files/drupal.make.yml . fi if [ ! -e "README.drupal8.md" ]; then cp $SHARE/drupal8/files/README.drupal8.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.drupal8 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