我有以下Makefile:
host-1
我希望能够从host-2
/ deploy
任务中指定deploy-production
/ deploy-{1,2}
的值,以便它们基本上可以部署到不同的主机。
有没有办法从另一个任务调用任务,并传递参数?
注意:我使用var days = ['Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrijdag', 'Zaterdag', 'Zondag'];
var availabilityDays = JSON.parse(value);
for (var day of days) {
var details = availabilityDays.find(function (detail) {
return detail.day == day;
});
var detailsText = '';
if (details) {
detailsText = details['fromtime']+' - '+details['totime']
}
$jq('#availability').append('<div class="col-sm-5">'+day+'</div><div class="col-sm-7">' + detailsText + '</div>');
}
而不是某种for循环的原因是我希望能够并行运行目标。
答案 0 :(得分:0)
好的,找到了一种使用目标变量的方法:
deploy-1:
do_stuff $(host1)
deploy-2:
do_stuff $(host2)
deploy: host1 = host1.net
deploy: host2 = host2.net
deploy: deploy-1 deploy-2
deploy-production: host1 = host1-prod.net
deploy-production: host2 = host2-prod.net
deploy-production: deploy-1 deploy-2