From 8dea6ab80bd81546a23584e66e8a57369c246ce7 Mon Sep 17 00:00:00 2001 From: David Ferlay Date: Thu, 28 Mar 2019 15:31:26 +0100 Subject: [PATCH 1/3] Make info update : Added prefix + exposed traefik port + filtered exposed containers --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5cdf538a2..c3fad6a61 100644 --- a/Makefile +++ b/Makefile @@ -89,8 +89,8 @@ endif ## Project's containers information info: $(info Containers for "$(COMPOSE_PROJECT_NAME)" info:) - $(eval CONTAINERS = $(shell docker ps -f name=$(COMPOSE_PROJECT_NAME) --format "{{ .ID }}")) - $(foreach CONTAINER, $(CONTAINERS),$(info $(shell printf '%-19s \n' $(shell docker inspect --format='{{.NetworkSettings.Networks.$(COMPOSE_NET_NAME).IPAddress}} {{range $$p, $$conf := .NetworkSettings.Ports}}{{$$p}}{{end}} {{.Name}}' $(CONTAINER) | rev | sed "s/pct\//,pct:/g" | sed "s/,//" | rev | awk '{ print $0}')) )) + $(eval CONTAINERS = $(shell docker ps -f name=$(COMPOSE_PROJECT_NAME) --format "{{ .ID }}" -f 'label=traefik.enable=true')) + $(foreach CONTAINER, $(CONTAINERS),$(info http://$(shell printf '%-19s \n' $(shell docker inspect --format='{{.NetworkSettings.Networks.$(COMPOSE_NET_NAME).IPAddress}}:{{index .Config.Labels "traefik.port"}} {{range $$p, $$conf := .NetworkSettings.Ports}}{{$$p}}{{end}} {{.Name}}' $(CONTAINER) | rev | sed "s/pct\//,pct:/g" | sed "s/,//" | rev | awk '{ print $0}')) )) @echo "$(RESULT)" ## Run shell in PHP container as regular user From 7f45423cd99f0195b0d60e016e77fd7d2aff40bb Mon Sep 17 00:00:00 2001 From: David Ferlay Date: Tue, 9 Apr 2019 10:39:31 +0200 Subject: [PATCH 2/3] Update Makefile for proper integration of git hooks script file check commit 78b88e98eb36458e3d89115d236b2170910aeb3a Author: David Ferlay Date: Mon Apr 8 19:37:50 2019 +0200 commit 160a6bb79a34efcd65bb4ffdd4e3d8efe17b8d06 Author: David Ferlay Date: Wed Apr 3 17:48:30 2019 +0200 --- Makefile | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 33ad3c0e6..1213d76cc 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # Add utility functions and scripts to the container include scripts/makefile/*.mk -.PHONY: all provision si exec exec0 down clean dev info phpcs phpcbf drush check +.PHONY: all provision si exec exec0 down clean dev info phpcs phpcbf drush check hooksymlink hookexec .DEFAULT_GOAL := help # https://stackoverflow.com/a/6273809/1826109 @@ -41,11 +41,9 @@ phpcsexec = docker run --rm \ --ignore=*.css,libraries/*,dist/*,styleguide/* \ . -$(info Installing git hooks) -$(shell ln -sfn ../../scripts/git_hooks/pre-commit.sh .git/hooks/pre-commit) ## Full site install from the scratch -all: | provision composer si info +all: | provision composer si hooksymlink info ## Provision enviroment provision: @@ -150,3 +148,22 @@ phpcs: ## Fix codebase according to Drupal standards https://www.drupal.org/docs/develop/standards phpcbf: @$(call phpcsexec, phpcbf) + +## Add symbolic link from custom script(s) to /.git/hooks/pre-commit +hooksymlink: +ifneq ("$(wildcard scripts/git_hooks/pre-commit.sh)","") + @echo "Installing git hooks" + $(shell ln -sf ../../scripts/git_hooks/pre-commit.sh .git/hooks/pre-commit) +else + @echo "scripts/git_hooks/pre-commit.sh file does not exist" +endif + + +## Execute git hooks +hookexec: +ifneq ("$(wildcard scripts/git_hooks/pre-commit.sh)","") + @echo "Executing git hooks" + @/bin/sh ./scripts/git_hooks/pre-commit.sh +else + @echo "scripts/git_hooks/pre-commit.sh file does not exist" +endif \ No newline at end of file From b3f2d478ec6120b84cbdc2839020c2b31ccb189a Mon Sep 17 00:00:00 2001 From: David Ferlay Date: Wed, 10 Apr 2019 17:39:05 +0200 Subject: [PATCH 3/3] Update Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1213d76cc..6e982d062 100644 --- a/Makefile +++ b/Makefile @@ -166,4 +166,4 @@ ifneq ("$(wildcard scripts/git_hooks/pre-commit.sh)","") @/bin/sh ./scripts/git_hooks/pre-commit.sh else @echo "scripts/git_hooks/pre-commit.sh file does not exist" -endif \ No newline at end of file +endif