Skip to content

Commit

Permalink
prevent multiple yarn builds of accounts and settings when running `m…
Browse files Browse the repository at this point in the history
…ake ci-node-generate` int the repo root
  • Loading branch information
wkloucek committed Nov 16, 2021
1 parent c397a98 commit 74e7344
Show file tree
Hide file tree
Showing 18 changed files with 49 additions and 8 deletions.
8 changes: 8 additions & 0 deletions .make/recursion.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

ifeq ($(MAKE_DEPTH),)
MAKE_DEPTH := 0
else
$(eval MAKE_DEPTH := $(shell echo "$$(( $(MAKE_DEPTH) + 1 ))" ) )
endif

export
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ ifneq (, $(shell which go 2> /dev/null)) # suppress `command not found warnings`
include .bingo/Variables.mk
endif

include .make/recursion.mk

.PHONY: help
help:
@echo "Please use 'make <target>' where <target> is one of the following:"
Expand Down Expand Up @@ -130,9 +132,10 @@ ci-go-generate:

.PHONY: ci-node-generate
ci-node-generate:
@for mod in $(OCIS_MODULES); do \
@if [ $(MAKE_DEPTH) -le 1 ]; then \
for mod in $(OCIS_MODULES); do \
$(MAKE) --no-print-directory -C $$mod ci-node-generate; \
done
done; fi;

.PHONY: go-mod-tidy
go-mod-tidy:
Expand Down
2 changes: 2 additions & 0 deletions accounts/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
SHELL := bash
NAME := accounts

include ../.make/recursion.mk

.PHONY: test-acceptance-webui
test-acceptance-webui:
./ui/tests/run-acceptance-test.sh $(FEATURE_PATH)
Expand Down
2 changes: 2 additions & 0 deletions glauth/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
SHELL := bash
NAME := glauth

include ../.make/recursion.mk

############ tooling ############
ifneq (, $(shell which go 2> /dev/null)) # suppress `command not found warnings` for non go targets in CI
include ../.bingo/Variables.mk
Expand Down
2 changes: 2 additions & 0 deletions graph-explorer/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
SHELL := bash
NAME := graph-explorer

include ../.make/recursion.mk

############ tooling ############
ifneq (, $(shell which go 2> /dev/null)) # suppress `command not found warnings` for non go targets in CI
include ../.bingo/Variables.mk
Expand Down
2 changes: 2 additions & 0 deletions graph/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
SHELL := bash
NAME := graph

include ../.make/recursion.mk

############ tooling ############
ifneq (, $(shell which go 2> /dev/null)) # suppress `command not found warnings` for non go targets in CI
include ../.bingo/Variables.mk
Expand Down
2 changes: 2 additions & 0 deletions idp/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
SHELL := bash
NAME := idp

include ../.make/recursion.mk

############ tooling ############
ifneq (, $(shell which go 2> /dev/null)) # suppress `command not found warnings` for non go targets in CI
include ../.bingo/Variables.mk
Expand Down
3 changes: 2 additions & 1 deletion idp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,6 @@
"webpack-manifest-plugin": "3.1.0",
"workbox-webpack-plugin": "4.3.1",
"yarn-deduplicate": "^3.1.0"
}
},
"packageManager": "[email protected]"
}
2 changes: 2 additions & 0 deletions ocis-pkg/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
SHELL := bash
NAME := ocis-pkg

include ../.make/recursion.mk

############ tooling ############
ifneq (, $(shell which go 2> /dev/null)) # suppress `command not found warnings` for non go targets in CI
include ../.bingo/Variables.mk
Expand Down
11 changes: 6 additions & 5 deletions ocis/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
SHELL := bash
NAME := ocis

include ../.make/recursion.mk

############ tooling ############
ifneq (, $(shell which go 2> /dev/null)) # suppress `command not found warnings` for non go targets in CI
include ../.bingo/Variables.mk
Expand Down Expand Up @@ -31,8 +33,7 @@ ci-go-generate: # CI runs ci-node-generate automatically before this target
@go generate ./...

.PHONY: ci-node-generate
ci-node-generate: # no need to recreate go code, just add assets
@make -C ../accounts ci-node-generate
@make -C ../graph-explorer ci-node-generate
@make -C ../settings ci-node-generate
@make -C ../web ci-node-generate
ci-node-generate: # ocis needs assets of all other modules
@if [ $(MAKE_DEPTH) -le 1 ]; then \
$(MAKE) --no-print-directory -C .. ci-node-generate \
; fi;
2 changes: 2 additions & 0 deletions ocs/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
SHELL := bash
NAME := ocs

include ../.make/recursion.mk

############ tooling ############
ifneq (, $(shell which go 2> /dev/null)) # suppress `command not found warnings` for non go targets in CI
include ../.bingo/Variables.mk
Expand Down
2 changes: 2 additions & 0 deletions proxy/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
SHELL := bash
NAME := proxy

include ../.make/recursion.mk

############ tooling ############
ifneq (, $(shell which go 2> /dev/null)) # suppress `command not found warnings` for non go targets in CI
include ../.bingo/Variables.mk
Expand Down
2 changes: 2 additions & 0 deletions settings/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
SHELL := bash
NAME := settings

include ../.make/recursion.mk

.PHONY: test-acceptance-webui
test-acceptance-webui:
./ui/tests/run-acceptance-test.sh $(FEATURE_PATH)
Expand Down
2 changes: 2 additions & 0 deletions storage/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
SHELL := bash
NAME := storage

include ../.make/recursion.mk

############ tooling ############
ifneq (, $(shell which go 2> /dev/null)) # suppress `command not found warnings` for non go targets in CI
include ../.bingo/Variables.mk
Expand Down
2 changes: 2 additions & 0 deletions store/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
SHELL := bash
NAME := store

include ../.make/recursion.mk

############ tooling ############
ifneq (, $(shell which go 2> /dev/null)) # suppress `command not found warnings` for non go targets in CI
include ../.bingo/Variables.mk
Expand Down
2 changes: 2 additions & 0 deletions thumbnails/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
SHELL := bash
NAME := thumbnails

include ../.make/recursion.mk

############ tooling ############
ifneq (, $(shell which go 2> /dev/null)) # suppress `command not found warnings` for non go targets in CI
include ../.bingo/Variables.mk
Expand Down
2 changes: 2 additions & 0 deletions web/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
SHELL := bash
NAME := web

include ../.make/recursion.mk

############ tooling ############
ifneq (, $(shell which go 2> /dev/null)) # suppress `command not found warnings` for non go targets in CI
include ../.bingo/Variables.mk
Expand Down
2 changes: 2 additions & 0 deletions webdav/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
SHELL := bash
NAME := webdav

include ../.make/recursion.mk

############ tooling ############
ifneq (, $(shell which go 2> /dev/null)) # suppress `command not found warnings` for non go targets in CI
include ../.bingo/Variables.mk
Expand Down

0 comments on commit 74e7344

Please sign in to comment.