123456789101112131415161718 |
- # AMI IDs
- AMITARGETS=indexer.ami.id
- PACKER=/usr/local/bin/packer
- all: $(AMITARGETS)
- %.ami.id: %.json scripts/* ephemeral_init/* configs/*
- $(eval VPC_ID=$(shell cd ../2.network && terraform output vpc_id))
- $(eval SUBNET_ID=$(shell cd ../2.network && terraform output subnet0_id))
- $(PACKER) validate -var "vpc_id=$(VPC_ID)" -var "subnet_id=$(SUBNET_ID)" $<
- $(PACKER) inspect $<
- $(PACKER) build -var "vpc_id=$(VPC_ID)" -var "subnet_id=$(SUBNET_ID)" $< 2>&1 | tee $(basename $(notdir $<)).log
- tail -2 $(basename $(notdir $<)).log | head -2 | awk 'match($$0, /ami-.*/) { print substr($$0, RSTART, RLENGTH) }' > $@
- clean:
- -rm $(AMITARGETS)
- -rm *.log
- -rm *.tmp
|