diff options
author | Jonathan Bauer | 2018-02-07 18:20:23 +0100 |
---|---|---|
committer | Jonathan Bauer | 2018-02-07 18:20:23 +0100 |
commit | 946d092886d02a70acf8c671297d396015fbbe63 (patch) | |
tree | f4638eb836f55b1be663c1c104417caf9c813b69 /Makefile | |
parent | Makefile: cleaned up help a bit (diff) | |
download | packer-templates-946d092886d02a70acf8c671297d396015fbbe63.tar.gz packer-templates-946d092886d02a70acf8c671297d396015fbbe63.tar.xz packer-templates-946d092886d02a70acf8c671297d396015fbbe63.zip |
Makefile: check_rootpw function & calls
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -48,6 +48,12 @@ ifdef DEBUG PACKER_OPTS += -var='headless=false' endif +define check_rootpw + ifndef ROOTPW + $(error No root password is set, set it as ROOTPW in your environment.) + endif +endef + .PHONY: all help clean all: help @@ -55,9 +61,7 @@ all: help # Creating base images ## $(BASETARGETS): - ifndef ROOTPW - $(error ROOTPW is not set) - endif + $(call check_rootpw) $(info ** Building template '$(@D)' using '$(BUILDER)' **) $(PACKER) build -only=$(BUILDER) \ $(PACKER_OPTS) \ @@ -76,6 +80,7 @@ $(BASETARGETS): # This should still only use base images $(PROVTARGETS): $(foreach flav, $(FLAVORS), %/$(flav)): %/base + $(call check_rootpw) $(info ** Provisioning '$(@D)' with '$(@F)' **) $(PACKER) build -only=$(BUILDER) \ $(PACKER_OPTS) \ @@ -97,6 +102,7 @@ $(foreach flav, $(FLAVORS), %/$(flav)): %/base # This should use provisioned image $(BOOTTARGETS): %/boot: % + $(call check_rootpw) $(info ** Generating boot files for '$(patsubst %/,%,$(dir $(@D))):$(notdir $(@D))' **) $(PACKER) build -only=$(BUILDER) \ $(PACKER_OPTS) \ |