From 3cb090037f6a99cc67d3615c7bc47cb6770926df Mon Sep 17 00:00:00 2001 From: Khalezin Dmitrii Date: Thu, 6 May 2021 00:23:13 +0300 Subject: [PATCH 01/12] #35 updated version for utils in aws-eks-utils image, added new image with terraform-utils --- .github/workflows/terraform-utils-image.yml | 23 +++++++++++++++++++++ docker/aws-eks-utils/Dockerfile | 18 ++++++++-------- docker/terraform-utils/Dockerfile | 18 ++++++++++++++++ 3 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/terraform-utils-image.yml create mode 100644 docker/terraform-utils/Dockerfile diff --git a/.github/workflows/terraform-utils-image.yml b/.github/workflows/terraform-utils-image.yml new file mode 100644 index 00000000..e8f16985 --- /dev/null +++ b/.github/workflows/terraform-utils-image.yml @@ -0,0 +1,23 @@ +name: 'Terraform-utils' + +on: + push: + branches: + - 'feature/terraform-utils' + paths: + - 'docker/terraform-utils/Dockerfile' + +jobs: + push_to_registries: + name: Push Docker image to multiple registries + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + - name: Push to Docker Hub + uses: docker/build-push-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + context: docker/terraform-utils/ + tags: maddevsio/terraform-utils:latest diff --git a/docker/aws-eks-utils/Dockerfile b/docker/aws-eks-utils/Dockerfile index 8409b1e6..ba9e42be 100644 --- a/docker/aws-eks-utils/Dockerfile +++ b/docker/aws-eks-utils/Dockerfile @@ -1,9 +1,9 @@ FROM alpine:3.10.1 -ARG TERRAFORM_VERSION="0.12.25" -ARG TERRAGRUNT_VERSION="0.22.4" -ARG HELM_VERSION="3.0.2" -ARG HELMFILE_VERSION="0.98.3" -ARG KUBECTL_VERSION="1.15.11" +ARG TERRAFORM_VERSION="0.15.1" +ARG TERRAGRUNT_VERSION="0.29.2" +ARG HELM_VERSION="3.5.4" +ARG HELMFILE_VERSION="0.138.7" +ARG KUBECTL_VERSION="1.21.0" ENV BASE_URL="https://get.helm.sh" ENV TAR_FILE="helm-v${HELM_VERSION}-linux-amd64.tar.gz" @@ -13,7 +13,7 @@ RUN echo "**** install Python ****" && \ if [ ! -e /usr/bin/python ]; then ln -sf python3 /usr/bin/python ; fi && \ \ echo "**** install pip ****" && \ - python3 -m ensurepip && \ + python3 -m ensurepip && \ pip3 install --no-cache --upgrade pip setuptools wheel && \ if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi @@ -50,15 +50,15 @@ RUN wget https://storage.googleapis.com/kubernetes-release/release/v"$KUBECTL_VE RUN curl -L https://amazon-eks.s3-us-west-2.amazonaws.com/1.13.7/2019-06-11/bin/linux/amd64/aws-iam-authenticator -o /usr/local/bin/aws-iam-authenticator \ && chmod +x /usr/local/bin/aws-iam-authenticator -#Install docker -RUN apk add --no-cache --update docker +#Install docker +RUN apk add --no-cache --update docker #Install helmfile RUN wget https://github.com/roboll/helmfile/releases/download/v${HELMFILE_VERSION}/helmfile_linux_amd64 \ && chmod +x helmfile_linux_amd64 && mv helmfile_linux_amd64 /bin/helmfile # Install ssh -RUN apk add openssh +RUN apk add openssh ENTRYPOINT [""] diff --git a/docker/terraform-utils/Dockerfile b/docker/terraform-utils/Dockerfile new file mode 100644 index 00000000..c48ce503 --- /dev/null +++ b/docker/terraform-utils/Dockerfile @@ -0,0 +1,18 @@ +FROM alpine:3.10.1 +ARG TERRAFORM_VERSION="0.15.1" + +WORKDIR /tmp + +#Install tfenv for terraform +RUN apk add --update --no-cache openssl git bash curl unzip sudo && \ + git clone https://github.com/tfutils/tfenv.git /usr/bin/.tfenv && \ + ln -s /usr/bin/.tfenv/bin/* /usr/bin && \ + chmod +x /usr/bin/tfenv + +#Install terraform +RUN tfenv install $TERRAFORM_VERSION + +#Install tflint +RUN curl https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash + +ENTRYPOINT [""] From 1a8c5966df1f9fe235e365ae2b5c675921ea95a4 Mon Sep 17 00:00:00 2001 From: Khalezin Dmitrii Date: Thu, 6 May 2021 00:40:04 +0300 Subject: [PATCH 02/12] #35 added login to DockerHub --- .github/workflows/terraform-utils-image.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/terraform-utils-image.yml b/.github/workflows/terraform-utils-image.yml index e8f16985..d0ff4acb 100644 --- a/.github/workflows/terraform-utils-image.yml +++ b/.github/workflows/terraform-utils-image.yml @@ -4,20 +4,23 @@ on: push: branches: - 'feature/terraform-utils' - paths: - - 'docker/terraform-utils/Dockerfile' + #paths: + # - 'docker/terraform-utils/Dockerfile' jobs: push_to_registries: - name: Push Docker image to multiple registries + name: Push Docker image runs-on: ubuntu-latest steps: - name: Check out the repo uses: actions/checkout@v2 - - name: Push to Docker Hub - uses: docker/build-push-action@v2 + - name: Login to DockerHub + uses: docker/login-action@v1 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build and push + uses: docker/build-push-action@v2 + with: context: docker/terraform-utils/ tags: maddevsio/terraform-utils:latest From cdf290c66e3591274e73759a5da0c20fd0fc51c9 Mon Sep 17 00:00:00 2001 From: Khalezin Dmitrii Date: Thu, 6 May 2021 00:42:29 +0300 Subject: [PATCH 03/12] #35 added push option --- .github/workflows/terraform-utils-image.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/terraform-utils-image.yml b/.github/workflows/terraform-utils-image.yml index d0ff4acb..92780bf0 100644 --- a/.github/workflows/terraform-utils-image.yml +++ b/.github/workflows/terraform-utils-image.yml @@ -22,5 +22,6 @@ jobs: - name: Build and push uses: docker/build-push-action@v2 with: + push: true context: docker/terraform-utils/ tags: maddevsio/terraform-utils:latest From 01c6129049a0b6314ccc1f8acf6daa585a3f38df Mon Sep 17 00:00:00 2001 From: Khalezin Dmitrii Date: Thu, 6 May 2021 00:44:42 +0300 Subject: [PATCH 04/12] #35 chnaged images for terraform-ci --- .github/workflows/terraform-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/terraform-ci.yml b/.github/workflows/terraform-ci.yml index 55a85775..41111453 100644 --- a/.github/workflows/terraform-ci.yml +++ b/.github/workflows/terraform-ci.yml @@ -12,7 +12,7 @@ jobs: name: 'Terraform-validate' runs-on: ubuntu-latest container: - image: hashicorp/terraform:0.15.1 + image: maddevsio/terraform-utils:latest env: PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin steps: @@ -36,7 +36,7 @@ jobs: name: 'Terraform-format' runs-on: ubuntu-latest container: - image: hashicorp/terraform:0.15.1 + image: maddevsio/terraform-utils:latest env: PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin steps: @@ -50,7 +50,7 @@ jobs: name: 'Terraform-tflint' runs-on: ubuntu-latest container: - image: wata727/tflint + image: maddevsio/terraform-utils:latest env: PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin steps: From d0889d4a12dc7afc700ea328e0ddc034c77ccfc4 Mon Sep 17 00:00:00 2001 From: Khalezin Dmitrii Date: Thu, 6 May 2021 00:48:55 +0300 Subject: [PATCH 05/12] #35 chnaged path for terraform-utils, and added workind directory for terraform fmt --- .github/workflows/terraform-ci.yml | 1 + .github/workflows/terraform-utils-image.yml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/terraform-ci.yml b/.github/workflows/terraform-ci.yml index 41111453..b329261c 100644 --- a/.github/workflows/terraform-ci.yml +++ b/.github/workflows/terraform-ci.yml @@ -44,6 +44,7 @@ jobs: uses: actions/checkout@v2 - name: Terraform Format run: terraform fmt -recursive -write=false -check . + working-directory: ./terraform # Checks that all Terraform configuration files tflint terraform-tflint: diff --git a/.github/workflows/terraform-utils-image.yml b/.github/workflows/terraform-utils-image.yml index 92780bf0..2df34393 100644 --- a/.github/workflows/terraform-utils-image.yml +++ b/.github/workflows/terraform-utils-image.yml @@ -4,8 +4,8 @@ on: push: branches: - 'feature/terraform-utils' - #paths: - # - 'docker/terraform-utils/Dockerfile' + paths: + - 'docker/terraform-utils/Dockerfile' jobs: push_to_registries: From 5443a11b8a01f612f34c83166347051bfa7ac517 Mon Sep 17 00:00:00 2001 From: Khalezin Dmitrii Date: Thu, 6 May 2021 00:52:27 +0300 Subject: [PATCH 06/12] #35 changed branch for terraform utils --- .github/workflows/terraform-utils-image.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/terraform-utils-image.yml b/.github/workflows/terraform-utils-image.yml index 2df34393..14387e64 100644 --- a/.github/workflows/terraform-utils-image.yml +++ b/.github/workflows/terraform-utils-image.yml @@ -3,13 +3,13 @@ name: 'Terraform-utils' on: push: branches: - - 'feature/terraform-utils' + - 'main' paths: - 'docker/terraform-utils/Dockerfile' jobs: push_to_registries: - name: Push Docker image + name: Build and Push Docker image runs-on: ubuntu-latest steps: - name: Check out the repo @@ -19,7 +19,7 @@ jobs: with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Build and push + - name: Build and Push uses: docker/build-push-action@v2 with: push: true From ef8f998d6861f739fcb1059962edbada7b06c44a Mon Sep 17 00:00:00 2001 From: Khalezin Dmitrii Date: Thu, 6 May 2021 00:57:43 +0300 Subject: [PATCH 07/12] #35 added workflow for aws-eks-utils --- .github/workflows/aws-eks-utils-image.yml | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/aws-eks-utils-image.yml diff --git a/.github/workflows/aws-eks-utils-image.yml b/.github/workflows/aws-eks-utils-image.yml new file mode 100644 index 00000000..381131dc --- /dev/null +++ b/.github/workflows/aws-eks-utils-image.yml @@ -0,0 +1,27 @@ +name: 'aws-eks-utils' + +on: + push: + branches: + - 'main' + paths: + - 'feature/terraform-utils' + +jobs: + push_to_registries: + name: Build and Push Docker image + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build and Push + uses: docker/build-push-action@v2 + with: + push: true + context: docker/aws-eks-utils/ + tags: maddevsio/aws-eks-utils:latest From e5809559e97ca3af229cfb1119b5abec6008dcc0 Mon Sep 17 00:00:00 2001 From: Khalezin Dmitrii Date: Thu, 6 May 2021 00:59:47 +0300 Subject: [PATCH 08/12] #35 changed branch for aws-eks forkflow --- .github/workflows/aws-eks-utils-image.yml | 4 ++-- docker/aws-eks-utils/Dockerfile | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/aws-eks-utils-image.yml b/.github/workflows/aws-eks-utils-image.yml index 381131dc..e661d10a 100644 --- a/.github/workflows/aws-eks-utils-image.yml +++ b/.github/workflows/aws-eks-utils-image.yml @@ -3,9 +3,9 @@ name: 'aws-eks-utils' on: push: branches: - - 'main' - paths: - 'feature/terraform-utils' + paths: + - 'aws-eks-utils/Dockerfile' jobs: push_to_registries: diff --git a/docker/aws-eks-utils/Dockerfile b/docker/aws-eks-utils/Dockerfile index ba9e42be..eb41a3f2 100644 --- a/docker/aws-eks-utils/Dockerfile +++ b/docker/aws-eks-utils/Dockerfile @@ -60,5 +60,4 @@ RUN wget https://github.com/roboll/helmfile/releases/download/v${HELMFILE_VERSIO # Install ssh RUN apk add openssh - ENTRYPOINT [""] From 158869291b3d102e8e4fad306062bb869be35207 Mon Sep 17 00:00:00 2001 From: Khalezin Dmitrii Date: Thu, 6 May 2021 01:01:15 +0300 Subject: [PATCH 09/12] #35 changed path to dockerfile --- .github/workflows/aws-eks-utils-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/aws-eks-utils-image.yml b/.github/workflows/aws-eks-utils-image.yml index e661d10a..41267fb2 100644 --- a/.github/workflows/aws-eks-utils-image.yml +++ b/.github/workflows/aws-eks-utils-image.yml @@ -5,7 +5,7 @@ on: branches: - 'feature/terraform-utils' paths: - - 'aws-eks-utils/Dockerfile' + - 'docker/aws-eks-utils/Dockerfile' jobs: push_to_registries: From aa6c73fd2a6ab772fd4552485855bc097ae2f233 Mon Sep 17 00:00:00 2001 From: Khalezin Dmitrii Date: Thu, 6 May 2021 01:02:26 +0300 Subject: [PATCH 10/12] #35 added whitespace in Dockerfile --- docker/aws-eks-utils/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/aws-eks-utils/Dockerfile b/docker/aws-eks-utils/Dockerfile index eb41a3f2..1ec452e9 100644 --- a/docker/aws-eks-utils/Dockerfile +++ b/docker/aws-eks-utils/Dockerfile @@ -1,4 +1,5 @@ FROM alpine:3.10.1 + ARG TERRAFORM_VERSION="0.15.1" ARG TERRAGRUNT_VERSION="0.29.2" ARG HELM_VERSION="3.5.4" From ffc7c5e5147b67c22c2a2032fa692839bc2a1e92 Mon Sep 17 00:00:00 2001 From: Khalezin Dmitrii Date: Thu, 6 May 2021 01:05:27 +0300 Subject: [PATCH 11/12] #35 changed branch for aws-eks-utils workflow --- .github/workflows/aws-eks-utils-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/aws-eks-utils-image.yml b/.github/workflows/aws-eks-utils-image.yml index 41267fb2..a242a424 100644 --- a/.github/workflows/aws-eks-utils-image.yml +++ b/.github/workflows/aws-eks-utils-image.yml @@ -3,7 +3,7 @@ name: 'aws-eks-utils' on: push: branches: - - 'feature/terraform-utils' + - 'main' paths: - 'docker/aws-eks-utils/Dockerfile' From aa20e022e3bc7a856dc0f6988fe06f89e3bd6f25 Mon Sep 17 00:00:00 2001 From: Khalezin Dmitrii Date: Thu, 6 May 2021 10:06:17 +0300 Subject: [PATCH 12/12] #35 changed alpine version for aws-eks-utils and terraform-utils Dockerfiles --- docker/aws-eks-utils/Dockerfile | 2 +- docker/terraform-utils/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/aws-eks-utils/Dockerfile b/docker/aws-eks-utils/Dockerfile index 1ec452e9..f73420b0 100644 --- a/docker/aws-eks-utils/Dockerfile +++ b/docker/aws-eks-utils/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.10.1 +FROM alpine:3.13.5 ARG TERRAFORM_VERSION="0.15.1" ARG TERRAGRUNT_VERSION="0.29.2" diff --git a/docker/terraform-utils/Dockerfile b/docker/terraform-utils/Dockerfile index c48ce503..d18b701f 100644 --- a/docker/terraform-utils/Dockerfile +++ b/docker/terraform-utils/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.10.1 +FROM alpine:3.13.5 ARG TERRAFORM_VERSION="0.15.1" WORKDIR /tmp