diff --git a/modules/packages/Makefile b/modules/packages/Makefile index b7a2bcd6..4cae84b6 100644 --- a/modules/packages/Makefile +++ b/modules/packages/Makefile @@ -14,22 +14,22 @@ packages/reinstall: packages/delete packages/install ## Install packages packages/install: @if [ ! -d $(PACKAGES_PATH) ]; then \ - echo "* Installing packages $(PACKAGES_VERSION)..."; \ - rm -rf $(PACKAGES_PATH); \ - $(GIT) clone -c advice.detachedHead=false --depth=1 -b $(PACKAGES_VERSION) https://github.com/cloudposse/packages.git $(PACKAGES_PATH); \ - rm -rf $(PACKAGES_PATH)/.git; \ + echo "* Installing packages $(PACKAGES_VERSION)..."; \ + rm -rf $(PACKAGES_PATH); \ + $(GIT) clone -c advice.detachedHead=false --depth=1 -b $(PACKAGES_VERSION) https://github.com/cloudposse/packages.git $(PACKAGES_PATH); \ + rm -rf $(PACKAGES_PATH)/.git; \ fi ## Install package (e.g. helm, helmfile, kubectl) packages/install/%: @binary="$*"; \ if [[ -x "$(INSTALL_PATH)/$$binary" ]]; then \ - echo "* Package $$binary already installed"; \ + echo "* Package $$binary already installed"; \ elif [[ "$(PACKAGES_PREFER_HOST)" == "true" ]] && installed=$$(command -v $* 2>/dev/null); then \ - echo Using "$*" from "$$installed" ; \ + echo Using "$*" from "$$installed" ; \ else \ - $(MAKE) packages/install && \ - echo "* Installing $* to $(INSTALL_PATH)" && \ + $(MAKE) packages/install && \ + echo "* Installing $* to $(INSTALL_PATH)" && \ $(MAKE) -C $(PACKAGES_PATH)/install "$*"; \ fi; diff --git a/modules/terraform/Makefile b/modules/terraform/Makefile index 88c059bb..5c560b7f 100644 --- a/modules/terraform/Makefile +++ b/modules/terraform/Makefile @@ -62,7 +62,7 @@ terraform/rewrite-readme-source: terraform/loosen-constraints: TERRAFORM = terraform-0.13 terraform/loosen-constraints: @for v in $$(find . -type f -name 'versions.tf'); do \ - DIR="$$(dirname $$v)"; \ + DIR="$$(dirname $$v)"; \ sed -i -E 's,\s\=\s*\"(.*[0-9.]+)(\,\s*<.*)", = "\1",g' "$$v" ; \ sed -i -E 's,=\s*"\s*~>,= ">=,g' "$$v" ; \ $(TERRAFORM) fmt "$$DIR" ; \ @@ -72,10 +72,10 @@ terraform/loosen-constraints: terraform/bump-tf-12-min-version: TERRAFORM = terraform-0.13 terraform/bump-tf-12-min-version: terraform/loosen-constraints @for v in $$(find . -type f -name 'versions.tf'); do \ - DIR="$$(dirname $$v)"; \ + DIR="$$(dirname $$v)"; \ PIN="$$(terraform-config-inspect --json "$$DIR" | jq -r '.required_core[]')" ; \ if vert "$$PIN" 0.12.25 >/dev/null; then \ - echo updating "$$v" ; \ + echo updating "$$v" ; \ sed -i -E 's,required_version\s*\=\s*\"(\~>|>\=)\s?(0\.12(\.\d+)?)\",required_version = ">= 0.12.26",g' "$$v" ; \ $(TERRAFORM) fmt $$DIR ; \ else \ @@ -87,7 +87,7 @@ terraform/bump-tf-12-min-version: terraform/loosen-constraints terraform/rewrite-required-providers: TERRAFORM = terraform-0.13 terraform/rewrite-required-providers: terraform/loosen-constraints @for v in $$(find . -type f -name 'versions.tf'); do \ - DIR="$$(dirname $$v)" ; \ + DIR="$$(dirname $$v)" ; \ KEEP_VERSION=$$(grep -Eo 'required_version\s*=\s*"(.*)"' "$$v" | cut -d '"' -f2) ; \ echo upgrading $$v ; \ terraform-0.13 0.13upgrade -yes "$$DIR" >/dev/null ; \ diff --git a/templates/Makefile.build-harness b/templates/Makefile.build-harness index fd5fa30f..a38afd72 100644 --- a/templates/Makefile.build-harness +++ b/templates/Makefile.build-harness @@ -22,9 +22,9 @@ init:: ## Clean build-harness clean:: @[ "$(BUILD_HARNESS_PATH)" == '/' ] || \ - [ "$(BUILD_HARNESS_PATH)" == '.' ] || \ - [ "$(BUILD_HARNESS_PATH)" == '/$(BUILD_HARNESS_PROJECT)' ] || \ - echo rm -rf $(BUILD_HARNESS_PATH) + [ "$(BUILD_HARNESS_PATH)" == '.' ] || \ + [ "$(BUILD_HARNESS_PATH)" == '/$(BUILD_HARNESS_PROJECT)' ] || \ + echo rm -rf $(BUILD_HARNESS_PATH) .PHONY: shell builder shell/pull builder/pull shell/pull builder/pull: @@ -32,7 +32,7 @@ shell/pull builder/pull: @exit 0 DEFAULT_DOCKER_ENVS := AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN TERM AWS_PROFILE AWS_REGION \ - AWS_DEFAULT_PROFILE AWS_DEFAULT_REGION + AWS_DEFAULT_PROFILE AWS_DEFAULT_REGION EXTRA_DOCKER_ENVS ?= AWS_CONFIG_FILE AWS_SHARED_CREDENTIALS_FILE MOUNT_HOME ?= $(shell [ -d "$$HOME" ] && printf -- "-e HOME -v \"%s\":\"%s\"" "$$HOME" "$$HOME") DOCKER_ENVS ?= $(DEFAULT_DOCKER_ENVS) $(EXTRA_DOCKER_ENVS)