From 8e039c4ecb8f20612ba1969d6426b7457e2dd389 Mon Sep 17 00:00:00 2001 From: HTWKalender Team Date: Tue, 16 Jul 2024 14:55:22 -0400 Subject: [PATCH] disable Git hook inside docker container --- Dockerfile | 4 ++-- Makefile | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 342b1b9..d4b0326 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,11 +10,11 @@ RUN apt-get update #apt-get install -y git && \ #git clone https://github.com/openHPI/poseidon.git . -COPY . . - # Install make (required for building) RUN apt-get install -y make +COPY . . + # Install required project libraries RUN make bootstrap diff --git a/Makefile b/Makefile index a6c6f7f..eff9632 100644 --- a/Makefile +++ b/Makefile @@ -43,10 +43,13 @@ tidy-deps: ## Remove unused dependencies .PHONY: git-hooks -git-hooks: .git/hooks/pre-commit ## Install the git-hooks -.git/hooks/%: git_hooks/% - cp $^ $@ - chmod 755 $@ +GIT_HOOKS_DIR := $(shell if [ -f .git ]; then echo $$(cat .git | sed 's/gitdir: //')/hooks; else echo .git/hooks; fi) +git-hooks: $(GIT_HOOKS_DIR)/pre-commit ## Install the git-hooks +$(GIT_HOOKS_DIR)/%: git_hooks/% + @if [ -d "$(GIT_HOOKS_DIR)" ]; then \ + cp $^ $@; \ + chmod 755 $@; \ + fi .PHONY: build build: deps ## Build the binary