Skip to content

Commit

Permalink
Pedantic linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuru committed Dec 10, 2020
1 parent 167c78a commit 4812b12
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions modules/packages/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions modules/terraform/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ; \
Expand All @@ -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 \
Expand All @@ -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 ; \
Expand Down
8 changes: 4 additions & 4 deletions templates/Makefile.build-harness
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ 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:
@docker pull $(BUILD_HARNESS_DOCKER_IMAGE):$(BUILD_HARNESS_DOCKER_TAG)
@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)
Expand Down

0 comments on commit 4812b12

Please sign in to comment.