From a6383c697ffa68ef0ecd4a0599db524ccdb9dda3 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 17 Nov 2017 13:13:43 -0200 Subject: Adds diff option --- share/templater/drupal8/files/Puppetfile | 47 ------------------------- share/templater/drupal8/files/puppet/Puppetfile | 47 +++++++++++++++++++++++++ share/templater/drupal8/setup | 4 +-- share/templater/templater/functions | 30 ++++++++++++++++ 4 files changed, 79 insertions(+), 49 deletions(-) delete mode 100644 share/templater/drupal8/files/Puppetfile create mode 100644 share/templater/drupal8/files/puppet/Puppetfile (limited to 'share') diff --git a/share/templater/drupal8/files/Puppetfile b/share/templater/drupal8/files/Puppetfile deleted file mode 100644 index 85b9e3c..0000000 --- a/share/templater/drupal8/files/Puppetfile +++ /dev/null @@ -1,47 +0,0 @@ -# Basic modules -mod "augeas", - :git => "https://git.fluxo.info/puppet-augeas" -mod "backup", - :git => "https://git.fluxo.info/puppet-backup" -mod "backupninja", - :git => "https://git.fluxo.info/puppet-backupninja", - :ref => "develop" -mod "concat", - :git => "https://git.fluxo.info/puppet-concat" -mod "cron", - :git => "https://git.fluxo.info/puppet-cron" -mod "domain_check", - :git => "https://git.fluxo.info/puppet-domain_check" -mod "exim", - :git => "https://git.fluxo.info/puppet-exim" -mod "lsb", - :git => "https://git.fluxo.info/puppet-lsb" -mod "nodo", - :git => "https://git.fluxo.info/puppet-nodo" -mod "rsyslog", - :git => "https://git.fluxo.info/puppet-rsyslog" -mod "shellprompt", - :git => "https://git.fluxo.info/shellprompt" -mod "sshd", - :git => "https://git.fluxo.info/puppet-sshd", - :ref => "develop" -mod "ssl", - :git => "https://git.fluxo.info/puppet-ssl" -mod "stdlib", - :git => "https://git.fluxo.info/puppet-stdlib" -mod "user", - :git => "https://git.fluxo.info/puppet-user" -mod "tunnel", - :git => "https://git.fluxo.info/puppet-tunnel" - -# Additional modules -mod "mysql", - :git => "https://git.fluxo.info/puppet-mysql" -mod "database", - :git => "https://git.fluxo.info/puppet-database" -mod "apache", - :git => "https://git.fluxo.info/puppet-apache" -mod "php", - :git => "https://git.fluxo.info/puppet-php" -mod "drupal", - :git => "https://git.fluxo.info/puppet-drupal" diff --git a/share/templater/drupal8/files/puppet/Puppetfile b/share/templater/drupal8/files/puppet/Puppetfile new file mode 100644 index 0000000..85b9e3c --- /dev/null +++ b/share/templater/drupal8/files/puppet/Puppetfile @@ -0,0 +1,47 @@ +# Basic modules +mod "augeas", + :git => "https://git.fluxo.info/puppet-augeas" +mod "backup", + :git => "https://git.fluxo.info/puppet-backup" +mod "backupninja", + :git => "https://git.fluxo.info/puppet-backupninja", + :ref => "develop" +mod "concat", + :git => "https://git.fluxo.info/puppet-concat" +mod "cron", + :git => "https://git.fluxo.info/puppet-cron" +mod "domain_check", + :git => "https://git.fluxo.info/puppet-domain_check" +mod "exim", + :git => "https://git.fluxo.info/puppet-exim" +mod "lsb", + :git => "https://git.fluxo.info/puppet-lsb" +mod "nodo", + :git => "https://git.fluxo.info/puppet-nodo" +mod "rsyslog", + :git => "https://git.fluxo.info/puppet-rsyslog" +mod "shellprompt", + :git => "https://git.fluxo.info/shellprompt" +mod "sshd", + :git => "https://git.fluxo.info/puppet-sshd", + :ref => "develop" +mod "ssl", + :git => "https://git.fluxo.info/puppet-ssl" +mod "stdlib", + :git => "https://git.fluxo.info/puppet-stdlib" +mod "user", + :git => "https://git.fluxo.info/puppet-user" +mod "tunnel", + :git => "https://git.fluxo.info/puppet-tunnel" + +# Additional modules +mod "mysql", + :git => "https://git.fluxo.info/puppet-mysql" +mod "database", + :git => "https://git.fluxo.info/puppet-database" +mod "apache", + :git => "https://git.fluxo.info/puppet-apache" +mod "php", + :git => "https://git.fluxo.info/puppet-php" +mod "drupal", + :git => "https://git.fluxo.info/puppet-drupal" diff --git a/share/templater/drupal8/setup b/share/templater/drupal8/setup index f9c8dfc..738e4ec 100755 --- a/share/templater/drupal8/setup +++ b/share/templater/drupal8/setup @@ -43,9 +43,9 @@ function templater_drupal8 { fi if [ -d "puppet" ] && [ ! -e "puppet/Puppetfile" ]; then - cp $SHARE/drupal8/files/Puppetfile puppet/ + cp $SHARE/drupal8/files/puppet/Puppetfile puppet/ else - cp $SHARE/drupal8/files/Puppetfile puppet/Puppetfile.drupal8 + cp $SHARE/drupal8/files/puppet/Puppetfile puppet/Puppetfile.drupal8 fi if [ ! -e "bin/post-receive" ]; then diff --git a/share/templater/templater/functions b/share/templater/templater/functions index b8658d2..4507650 100644 --- a/share/templater/templater/functions +++ b/share/templater/templater/functions @@ -104,3 +104,33 @@ function templater_install_makefile { # echo Makefile.local >> .gitignore #fi } + +# Check differences +function templater_diff { + local module="$1" + local cwd="`pwd`" + + if [ -z "$module" ]; then + return + fi + + if [ ! -d "$SHARE/$module/files" ]; then + return + fi + + ( + cd $SHARE/$module/files + + find . -type f | while read file; do + # File exists, check differences + if [ -e "$cwd/$file" ]; then + diff -u $cwd/$file $file + else + # Use a templaterignore instead + if echo $file | grep -q -v 'example'; then + templater_echo "Missing $file" + fi + fi + done + ) +} -- cgit v1.2.3