From d2ecc679613de1591a793f77937d4ba4a233fd98 Mon Sep 17 00:00:00 2001 From: SadriG91 <74971461+SadriG91@users.noreply.github.com> Date: Fri, 20 Oct 2023 16:50:55 +0200 Subject: [PATCH] Add terraform version (#32) * Update awscli.yml * Update awscli.yml * Update to use GITHUB_TOKEN * Update Build and push Docker images Action to latest version * add new tf versions --- .github/workflows/terraform.yml | 4 ++++ terraform/1.1.0/Dockerfile | 10 ++++++++++ terraform/1.2.5/Dockerfile | 10 ++++++++++ terraform/1.3.4/Dockerfile | 10 ++++++++++ 4 files changed, 34 insertions(+) create mode 100644 terraform/1.1.0/Dockerfile create mode 100644 terraform/1.2.5/Dockerfile create mode 100644 terraform/1.3.4/Dockerfile diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 442fcfe..92f0b2c 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -25,6 +25,8 @@ jobs: run: | matrixJsonObject=$(echo $GIT_DIFF_FILTERED | jq --raw-input --raw-output 'gsub("'"'"'"; "") | split(" ") | map( { Dockerfile:.} ) | { include:. } | tostring') echo "::set-output name=matrix_json::$matrixJsonObject" + echo $matrixJsonObject + echo $matrix_json docker_image_build: needs: build_matrix @@ -39,6 +41,8 @@ jobs: - name: get version tag id: versionTag run: | + echo ${{ needs.build_matrix.outputs.matrix_json }} + echo ${{ fromJson(needs.build_matrix.outputs.matrix_json) }} versionTag=$(head -1 ./${{ matrix.Dockerfile }} | grep -o '[0-9.]\+' ) echo "versionTag=$versionTag" >> $GITHUB_ENV diff --git a/terraform/1.1.0/Dockerfile b/terraform/1.1.0/Dockerfile new file mode 100644 index 0000000..f7f7be7 --- /dev/null +++ b/terraform/1.1.0/Dockerfile @@ -0,0 +1,10 @@ +FROM hashicorp/terraform:1.1.0 as resource +RUN apk add --update --no-cache \ + ncurses \ + make \ + curl +RUN curl -sL https://taskfile.dev/install.sh | sh + +FROM resource +ENTRYPOINT [ "terraform" ] +CMD [ "--help" ] diff --git a/terraform/1.2.5/Dockerfile b/terraform/1.2.5/Dockerfile new file mode 100644 index 0000000..0c9bc7f --- /dev/null +++ b/terraform/1.2.5/Dockerfile @@ -0,0 +1,10 @@ +FROM hashicorp/terraform:1.2.5 as resource +RUN apk add --update --no-cache \ + ncurses \ + make \ + curl +RUN curl -sL https://taskfile.dev/install.sh | sh + +FROM resource +ENTRYPOINT [ "terraform" ] +CMD [ "--help" ] diff --git a/terraform/1.3.4/Dockerfile b/terraform/1.3.4/Dockerfile new file mode 100644 index 0000000..b0b1675 --- /dev/null +++ b/terraform/1.3.4/Dockerfile @@ -0,0 +1,10 @@ +FROM hashicorp/terraform:1.3.4 as resource +RUN apk add --update --no-cache \ + ncurses \ + make \ + curl +RUN curl -sL https://taskfile.dev/install.sh | sh + +FROM resource +ENTRYPOINT [ "terraform" ] +CMD [ "--help" ]