Skip to content

Commit

Permalink
Merge pull request #10307 from cladmi/backport/2018.10/pr/make/docker…
Browse files Browse the repository at this point in the history
…/handle_worktree

makefiles/docker.inc.mk: handle building in git worktree [backport 2018.10]
  • Loading branch information
cladmi authored Nov 2, 2018
2 parents 82be92a + f8023c8 commit 488771f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions makefiles/docker.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ DOCKER ?= docker
DOCKER_VOLUMES_AND_ENV += $(if $(wildcard $(GIT_CACHE_DIR)),-v $(GIT_CACHE_DIR):$(DOCKER_BUILD_ROOT)/gitcache)
DOCKER_VOLUMES_AND_ENV += $(if $(wildcard $(GIT_CACHE_DIR)),-e GIT_CACHE_DIR=$(DOCKER_BUILD_ROOT)/gitcache)

# Handle worktree by mounting the git common dir in the same location
_is_git_worktree = $(shell grep '^gitdir: ' $(RIOTBASE)/.git 2>/dev/null)
GIT_WORKTREE_COMMONDIR = $(shell git rev-parse --git-common-dir)
DOCKER_VOLUMES_AND_ENV += $(if $(_is_git_worktree),-v $(GIT_WORKTREE_COMMONDIR):$(GIT_WORKTREE_COMMONDIR))

# This will execute `make $(DOCKER_MAKECMDGOALS)` inside a Docker container.
# We do not push the regular $(MAKECMDGOALS) to the container's make command in
# order to only perform building inside the container and defer executing any
Expand Down

0 comments on commit 488771f

Please sign in to comment.