diff options
author | Thiago Abdo | 2019-10-25 10:58:35 +0200 |
---|---|---|
committer | Thiago Abdo | 2019-10-25 10:58:35 +0200 |
commit | b256d16a0fd523e2f949f4f59d17eac033181fd4 (patch) | |
tree | 1ae15d1abfc00ec42c3ec389d5496ba56ec298b0 /Makefile | |
parent | Make possible to reapply ansible scritps generating a new build from a provis... (diff) | |
download | packer-templates-b256d16a0fd523e2f949f4f59d17eac033181fd4.tar.gz packer-templates-b256d16a0fd523e2f949f4f59d17eac033181fd4.tar.xz packer-templates-b256d16a0fd523e2f949f4f59d17eac033181fd4.zip |
Make it possible to generate boot files from a specific image target
Signed-off-by: Thiago Abdo <tjabdo@inf.ufpr.br>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -55,6 +55,7 @@ PROVTARGETS := $(foreach template, $(TEMPLATES), $(foreach flavor, $(FLAVORS), $ REPROVTARGETS := $(foreach template, $(TEMPLATES), $(foreach flavor, $(FLAVORS), $(filter-out $(template)/$(flavor).latest,$(wildcard $(template)/$(flavor).*)))) BOOTTARGETS := $(foreach template, $(TEMPLATES), $(template)/base/boot) BOOTTARGETS += $(foreach prov, $(PROVTARGETS), $(prov)/boot) +CURBOOTTARGETS := $(foreach prov, $(REPROVTARGETS), $(prov)/boot) ifndef ANSIBLE_PROV_EXTRA_ARGS ANSIBLE_PROV_EXTRA_ARGS := @@ -169,10 +170,10 @@ $(PROVTARGETS) $(REPROVTARGETS): -var='extra_ansible_args=$(ANSIBLE_PROV_EXTRA_ARGS)' \ ansible-provisioner.json - # Generating boot files -$(BOOTTARGETS): -%/boot: % +$(BOOTTARGETS): %/boot: % + +$(BOOTTARGETS) $(CURBOOTTARGETS): $(eval BASE_DIR := $(if $(filter base,$(notdir $(@D))),\ ,\ $(if $(wildcard $(@D)/build/.),\ @@ -181,6 +182,9 @@ $(BOOTTARGETS): $(eval BUILD_DIR := $(if $(BASE_DIR),\ $(BASE_DIR)/build,\ $(@D))) + $(eval BUILD_DIR := $(if $(filter $(@), $(CURBOOTTARGETS)),\ + $(BASE_DIR)/build,\ + $(BUILD_DIR))) $(eval ANSIBLE_DIR_CUR := $(if $(BASE_DIR),\ $(BASE_DIR)/$(ANSIBLE_DIR_PROV),\ $(ANSIBLE_DIR_PROV))) |