Skip to content

Commit

Permalink
add options to configure packer/aws binary
Browse files Browse the repository at this point in the history
  • Loading branch information
M00nF1sh authored and mcrute committed May 10, 2019
1 parent ac67f2a commit b5a78b9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ ARCH ?= x86_64
BINARY_BUCKET_NAME ?= amazon-eks
SOURCE_AMI_OWNERS ?= 137112412989

PACKER_BINARY ?= packer
AWS_BINARY ?= aws

ifeq ($(ARCH), arm64)
INSTANCE_TYPE ?= a1.large
else
Expand All @@ -26,14 +29,14 @@ all: 1.10 1.11 1.12

.PHONY: validate
validate:
packer validate \
$(PACKER_BINARY) validate \
-var instance_type=$(INSTANCE_TYPE) \
eks-worker-al2.json

.PHONY: k8s
k8s: validate
@echo "$(T_GREEN)Building AMI for version $(T_YELLOW)$(VERSION)$(T_GREEN) on $(T_YELLOW)$(ARCH)$(T_RESET)"
$(eval SOURCE_AMI_ID := $(shell aws ec2 describe-images \
$(eval SOURCE_AMI_ID := $(shell $(AWS_BINARY) ec2 describe-images \
--output text \
--filters \
Name=owner-id,Values=$(SOURCE_AMI_OWNERS) \
Expand All @@ -47,7 +50,7 @@ k8s: validate
echo "$(T_RED)Failed to find candidate AMI!$(T_RESET)"; \
exit 1; \
fi
packer build \
$(PACKER_BINARY) build \
-var instance_type=$(INSTANCE_TYPE) \
-var kubernetes_version=$(VERSION) \
-var kubernetes_build_date=$(KUBERNETES_BUILD_DATE) \
Expand Down

0 comments on commit b5a78b9

Please sign in to comment.