我有一个在 aws 中部署 x 项目的 makefile
目标是像这样执行make:
make deploy-production
并看到这样的输出
Please select the project:
1) api
2) web
3) somethingelse
然后按下数字并继续,通过将选择分配给名为 project 的变量
我已经为受支持的环境“自动生成”目标,只想为项目构建多选项。我的示例 makefile 已删除不相关的内容:
ENVIRONMENTS := development staging production
TARGETS := $(foreach X,$(ENVIRONMENTS),deploy-$X)
$(TARGETS):
$(eval ENV:=$(subst deploy-,,$(@)))
# here want to ask for project, env i have already as resolved from above line