]> gitweb.fluxo.info Git - templater.git/commitdiff
Makefile: detect CONTAINER
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 18 Nov 2017 18:46:35 +0000 (16:46 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 18 Nov 2017 18:46:35 +0000 (16:46 -0200)
share/templater/drupal8/files/Makefile.drupal8
share/templater/templater/files/Makefile

index 9ff3dcc6574b05e73a23622f2849bc3edd9b7b64..7ecafe4c247efd84cbb7a5410ebea6332e01c37b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Makefile for a Drupal 8 Website
+# Makefile for a Drupal 8 Application - https://templater.fluxo.info
 #
 
 # Parameters
@@ -13,15 +13,6 @@ DESTDIR   ?= /var/www/data
 DRUPAL     = $(DESTDIR)/drupal-$(CORE)
 DRUSH      = drush -r $(DRUPAL) -l $(PROJECT)
 
-# Customization examples
-#CONTAINER  = vagrant
-#CONTAINER  = docker
-#DESTDIR   ?= vendor
-
-# Include local customizations/overrides, which might be .gitignore'd
-# See https://www.gnu.org/software/make/manual/html_node/Include.html
-#-include Makefile.local
-
 # Setup production environment
 production: submodules post_receive drush settings ownership
 
@@ -29,9 +20,6 @@ production: submodules post_receive drush settings ownership
 develop: submodules $(CONTAINER)
        #rm -rf $(DRUPAL)/sites/default
        #ln -s $(PROJECT) $(DRUPAL)/sites/default
-       #vagrant ssh -c "$(DRUSH) pm-enable devel -y"
-       echo '( cd /srv/kvmx && make drush )' | kvmx ssh
-       #kvmx    ssh    "$(DRUSH) pm-enable devel -y"
 
 # Old target
 # Install the platform
@@ -48,10 +36,14 @@ submodules:
 # Setup the virtual machine using vagrant
 vagrant:
        vagrant up
+       echo '( cd /srv/kvmx && make drush )' | vagrant ssh
+       #vagrant ssh -c "$(DRUSH) pm-enable devel -y"
 
 # Setup the virtual machine using kvmx
 kvmx:
        kvmx provision
+       echo '( cd /srv/kvmx && make drush )' | kvmx ssh
+       #kvmx ssh "$(DRUSH) pm-enable devel -y"
 
 # Old target
 # Download drupal, setup folder structure and config file
index 6527452a9c13237e057b3d7b0988512810c1bf6d..b6890f709aabd386b7d42b5febd60196bc8e5005 100644 (file)
@@ -5,6 +5,18 @@
 # any Makefile.* available in the current folder.
 #
 
+# Set CONTAINER based in what we have available in the system
+# This variable can be user in other, included Makefiles to handle virtualization tasks
+ifeq ($(shell which kvmx > /dev/null && test -s kvmxfile && echo yes), yes)
+       CONTAINER = kvmx
+else ifeq ($(shell which vagrant > /dev/null && test -s Vagrantfile && echo yes), yes)
+       CONTAINER = vagrant
+else ifeq ($(shell which docker > /dev/null && test -s Dockerfile && echo yes), yes)
+       CONTAINER = docker
+else
+  CONTAINER = ''
+endif
+
 # See http://unix.stackexchange.com/questions/32182/simple-command-line-http-server#32200
 #     http://php.net/manual/en/features.commandline.webserver.php
 serve:
@@ -13,10 +25,19 @@ serve:
        #python3 -m http.server
        #php -S localhost:8000
 
+# Configure a git post-receive hook
 post_receive:
        git config receive.denyCurrentBranch ignore
        test -s bin/post-receive && cd .git/hooks && ln -sf ../../bin/post-receive
 
 # Process any other Makefile whose filename matches Makefile.*
 # See https://www.gnu.org/software/make/manual/html_node/Include.html
+#
+# Some of those files might even contain local customizations/overrides
+# that can be .gitignore'd, like a Makefile.local for example.
 -include Makefile.*
+
+# Customization examples can be as simple as setting variables:
+#CONTAINER  = vagrant
+#CONTAINER  = docker
+#DESTDIR   ?= vendor