-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from confusdcodr/patch
Patch configuration errors
- Loading branch information
Showing
11 changed files
with
135 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
version: 1 | ||
|
||
update_configs: | ||
|
||
- package_manager: "terraform" | ||
directory: "/" | ||
update_schedule: "daily" | ||
|
||
- package_manager: "terraform" | ||
directory: "/tests/vault-py2" | ||
update_schedule: "daily" | ||
|
||
- package_manager: "terraform" | ||
directory: "/tests/vault-py3" | ||
update_schedule: "daily" | ||
|
||
- package_manager: "go:modules" | ||
directory: "/tests" | ||
update_schedule: "daily" | ||
|
||
- package_manager: "python" | ||
directory: "/" | ||
update_schedule: "live" | ||
|
||
- package_manager: "docker" | ||
directory: "/" | ||
update_schedule: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM plus3it/tardigrade-ci:0.0.8 | ||
|
||
WORKDIR /ci-harness | ||
ENTRYPOINT ["make"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,137 +1,3 @@ | ||
ARCH ?= amd64 | ||
OS ?= $(shell uname -s | tr '[:upper:]' '[:lower:']) | ||
CURL ?= curl --fail -sSL | ||
XARGS ?= xargs -I {} | ||
BIN_DIR ?= ${HOME}/bin | ||
TMP ?= /tmp | ||
FIND_EXCLUDES ?= -not \( -name .terraform -prune \) -not \( -name .terragrunt-cache -prune \) | ||
SHELL := /bin/bash | ||
|
||
PATH := $(BIN_DIR):${PATH} | ||
|
||
MAKEFLAGS += --no-print-directory | ||
SHELL := bash | ||
.SHELLFLAGS := -eu -o pipefail -c | ||
|
||
.PHONY: guard/% %/install %/lint | ||
|
||
GITHUB_ACCESS_TOKEN ?= 4224d33b8569bec8473980bb1bdb982639426a92 | ||
# Macro to return the download url for a github release | ||
# For latest release, use version=latest | ||
# To pin a release, use version=tags/<tag> | ||
# $(call parse_github_download_url,owner,repo,version,asset select query) | ||
parse_github_download_url = $(CURL) https://api.github.com/repos/$(1)/$(2)/releases/$(3)?access_token=$(GITHUB_ACCESS_TOKEN) | jq --raw-output '.assets[] | select($(4)) | .browser_download_url' | ||
|
||
# Macro to download a github binary release | ||
# $(call download_github_release,file,owner,repo,version,asset select query) | ||
download_github_release = $(CURL) -o $(1) $(shell $(call parse_github_download_url,$(2),$(3),$(4),$(5))) | ||
|
||
# Macro to download a hashicorp archive release | ||
# $(call download_hashicorp_release,file,app,version) | ||
download_hashicorp_release = $(CURL) -o $(1) https://releases.hashicorp.com/$(2)/$(3)/$(2)_$(3)_$(OS)_$(ARCH).zip | ||
|
||
guard/env/%: | ||
@ _="$(or $($*),$(error Make/environment variable '$*' not present))" | ||
|
||
guard/program/%: | ||
@ which $* > /dev/null || $(MAKE) $*/install | ||
|
||
$(BIN_DIR): | ||
@ echo "[make]: Creating directory '$@'..." | ||
mkdir -p $@ | ||
|
||
install/gh-release/%: guard/env/FILENAME guard/env/OWNER guard/env/REPO guard/env/VERSION guard/env/QUERY | ||
install/gh-release/%: | ||
@ echo "[$@]: Installing $*..." | ||
$(call download_github_release,$(FILENAME),$(OWNER),$(REPO),$(VERSION),$(QUERY)) | ||
chmod +x $(FILENAME) | ||
$* --version | ||
@ echo "[$@]: Completed successfully!" | ||
|
||
zip/install: | ||
@ echo "[$@]: Installing $(@D)..." | ||
apt-get install zip -y | ||
@ echo "[$@]: Completed successfully!" | ||
|
||
terraform/install: TERRAFORM_VERSION_LATEST := $(CURL) https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M '.current_version' | sed 's/^v//' | ||
terraform/install: TERRAFORM_VERSION ?= $(shell $(TERRAFORM_VERSION_LATEST)) | ||
terraform/install: | $(BIN_DIR) guard/program/jq | ||
@ echo "[$@]: Installing $(@D)..." | ||
$(call download_hashicorp_release,$(@D).zip,$(@D),$(TERRAFORM_VERSION)) | ||
unzip $(@D).zip && rm -f $(@D).zip && chmod +x $(@D) | ||
mv $(@D) "$(BIN_DIR)" | ||
$(@D) --version | ||
@ echo "[$@]: Completed successfully!" | ||
|
||
terraform-docs/install: TFDOCS_VERSION ?= latest | ||
terraform-docs/install: | $(BIN_DIR) guard/program/jq | ||
@ $(MAKE) install/gh-release/$(@D) FILENAME="$(BIN_DIR)/$(@D)" OWNER=segmentio REPO=$(@D) VERSION=$(TFDOCS_VERSION) QUERY='.name | endswith("$(OS)-$(ARCH)")' | ||
|
||
jq/install: JQ_VERSION ?= latest | ||
jq/install: | $(BIN_DIR) | ||
@ $(MAKE) install/gh-release/$(@D) FILENAME="$(BIN_DIR)/$(@D)" OWNER=stedolan REPO=$(@D) VERSION=$(JQ_VERSION) QUERY='.name | endswith("$(OS)64")' | ||
|
||
shellcheck/install: SHELLCHECK_VERSION ?= latest | ||
shellcheck/install: SHELLCHECK_URL ?= https://storage.googleapis.com/shellcheck/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz | ||
shellcheck/install: $(BIN_DIR) guard/program/xz | ||
$(CURL) $(SHELLCHECK_URL) | tar -xJv | ||
mv $(@D)-*/$(@D) $(BIN_DIR) | ||
rm -rf $(@D)-* | ||
$(@D) --version | ||
|
||
terraform/lint: | guard/program/terraform | ||
@ echo "[$@]: Linting Terraform files..." | ||
terraform fmt -check=true -diff=true | ||
@ echo "[$@]: Terraform files PASSED lint test!" | ||
|
||
sh/%: FIND_SH := find . $(FIND_EXCLUDES) -name '*.sh' -type f -print0 | ||
sh/lint: | guard/program/shellcheck | ||
@ echo "[$@]: Linting shell scripts..." | ||
$(FIND_SH) | $(XARGS) shellcheck {} -e SC2154,SC2086 | ||
@ echo "[$@]: Shell scripts PASSED lint test!" | ||
|
||
json/%: FIND_JSON := find . $(FIND_EXCLUDES) -name '*.json' -type f | ||
json/lint: | guard/program/jq | ||
@ echo "[$@]: Linting JSON files..." | ||
$(FIND_JSON) | $(XARGS) bash -c 'cmp {} <(jq --indent 4 -S . {}) || (echo "[{}]: Failed JSON Lint Test"; exit 1)' | ||
@ echo "[$@]: JSON files PASSED lint test!" | ||
|
||
json/format: | guard/program/jq | ||
@ echo "[$@]: Formatting JSON files..." | ||
$(FIND_JSON) | $(XARGS) bash -c 'echo "$$(jq --indent 4 -S . "{}")" > "{}"' | ||
@ echo "[$@]: Successfully formatted JSON files!" | ||
|
||
tfdocs-awk/install: $(BIN_DIR) | ||
tfdocs-awk/install: ARCHIVE := https://github.com/plus3it/tfdocs-awk/archive/0.0.2.tar.gz | ||
tfdocs-awk/install: | ||
$(CURL) $(ARCHIVE) | tar -C $(BIN_DIR) --strip-components=1 --wildcards '*.sh' --wildcards '*.awk' -xzvf - | ||
|
||
docs/generate: | tfdocs-awk/install guard/program/terraform-docs | ||
@ echo "[$@]: Creating documentation files.." | ||
@ bash -eu -o pipefail autodocs.sh -g | ||
@ echo "[$@]: Documentation generated!" | ||
|
||
docs/lint: | tfdocs-awk/install guard/program/terraform-docs | ||
@ echo "[$@] Linting documentation files.." | ||
@ bash -eu -o pipefail autodocs.sh -l | ||
@ echo "[$@] Documentation linting complete!" | ||
|
||
python/lint: | guard/program/black | ||
@ echo "[$@]: Linting Python files..." | ||
black --check . | ||
@ echo "[$@]: Python files PASSED lint test!" | ||
|
||
python/format: | guard/program/black | ||
@ echo "[$@]: Formatting Python files..." | ||
black . | ||
@ echo "[$@]: Successfully formatted Python files!" | ||
|
||
|
||
terratest/install: | guard/program/go | ||
cd tests && go mod init terraform-aws-vault/tests | ||
cd tests && go build ./... | ||
cd tests && go mod tidy | ||
|
||
terratest/test: | guard/program/go | ||
cd tests && go test -count=1 -timeout 60m | ||
|
||
test: terratest/test | ||
-include $(shell curl -sSL -o .tardigrade-ci "https://raw.githubusercontent.com/plus3it/tardigrade-ci/master/bootstrap/Makefile.bootstrap"; echo .tardigrade-ci) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.