关注不起作用,你知道为什么吗?
注意:CURRENT_CLUSTER不是“ my-local-cluster”,并且stil失败。
check-env:
ifeq ($(CURRENT_CLUSTER), 'my-local-cluster')
$(error CURRENT_CLUSTER is local $(CURRENT_CLUSTER), should be production cluster)
endif
答案 0 :(得分:1)
也许您想要的是:
check-env:
ifeq ($(CURRENT_CLUSTER),my-local-cluster)
$(error CURRENT_CLUSTER is local $(CURRENT_CLUSTER), should be production cluster)
endif
@echo Whatever
all:
@echo "Still good"
这将产生以下结果:
$ make check-env CURRENT_CLUSTER=my-local-cluster
Makefile:220: *** CURRENT_CLUSTER is local my-local-cluster, should be
$ make all CURRENT_CLUSTER=my-local-cluster
Still good
$ make check-env CURRENT_CLUSTER=anything
Whatever