-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
get_terraform_versions_dockerized.sh
- Loading branch information
1 parent
f7c1c21
commit a85694e
Showing
8 changed files
with
31 additions
and
56 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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
FROM golang:1.22.3 | ||
|
||
RUN apt-get update && apt-get install --yes jq vim | ||
RUN apt-get update && apt-get install --yes jq | ||
|
||
# https://pkg.go.dev/github.com/hashicorp/terraform-config-inspect?tab=versions | ||
RUN go install github.com/hashicorp/terraform-config-inspect@v0.0.0-20240509232506-4708120f8f30 | ||
|
||
CMD external/scripts/run_from_docker_container.sh | ||
CMD external/scripts/get_terraform_versions_json.sh external |
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,6 +1,4 @@ | ||
#!/bin/bash | ||
|
||
DOCKER_IMAGE_TAG="tf-config-inspect" | ||
|
||
docker build --tag "${DOCKER_IMAGE_TAG}" "." | ||
docker run --rm --volume ".:/go/external" "${DOCKER_IMAGE_TAG}" | ||
source scripts/get_terraform_versions_dockerized.sh | ||
scripts/edit_cookiecutter_json.sh |
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 was deleted.
Oops, something went wrong.
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,15 @@ | ||
#!/bin/bash | ||
|
||
DOCKER_IMAGE_TAG="tf-config-inspect" | ||
|
||
docker build --tag "${DOCKER_IMAGE_TAG}" "." | ||
|
||
ALL_TERRAFORM_VERSIONS=$( docker run --rm --volume ".:/go/external" "${DOCKER_IMAGE_TAG}" ) | ||
|
||
echo "ALL_TERRAFORM_VERSIONS = ${ALL_TERRAFORM_VERSIONS}" | ||
|
||
export TERRAFORM_VERSION=$( echo "${ALL_TERRAFORM_VERSIONS}" | jq --raw-output '.terraform_version' ) | ||
echo "TERRAFORM_VERSION = ${TERRAFORM_VERSION}" | ||
|
||
export TERRAFORM_AWS_VERSION=$( echo "${ALL_TERRAFORM_VERSIONS}" | jq --raw-output '.terraform_aws_version' ) | ||
echo "TERRAFORM_AWS_VERSION = ${TERRAFORM_AWS_VERSION}" |
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,10 @@ | ||
#!/bin/bash | ||
|
||
TERRAFORM_PROD_DIR="$1" | ||
[[ -z "${TERRAFORM_PROD_DIR}" ]] && echo '{ "error": "TERRAFORM_PROD_DIR must be passed as first argument" }' && exit 10 | ||
|
||
terraform-config-inspect --json "${TERRAFORM_PROD_DIR}" | \ | ||
jq --monochrome-output --compact-output '{ | ||
"terraform_version": .required_core[0], | ||
"terraform_aws_version": .required_providers.aws.version_constraints[0] | ||
}' |
This file was deleted.
Oops, something went wrong.