diff --git a/.github/workflows/aws-eks-utils-image.yml b/.github/workflows/aws-eks-utils-image.yml new file mode 100644 index 00000000..a242a424 --- /dev/null +++ b/.github/workflows/aws-eks-utils-image.yml @@ -0,0 +1,27 @@ +name: 'aws-eks-utils' + +on: + push: + branches: + - 'main' + paths: + - 'docker/aws-eks-utils/Dockerfile' + +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 diff --git a/.github/workflows/terraform-ci.yml b/.github/workflows/terraform-ci.yml index 55a85775..b329261c 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: @@ -44,13 +44,14 @@ 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: 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: diff --git a/.github/workflows/terraform-utils-image.yml b/.github/workflows/terraform-utils-image.yml new file mode 100644 index 00000000..14387e64 --- /dev/null +++ b/.github/workflows/terraform-utils-image.yml @@ -0,0 +1,27 @@ +name: 'Terraform-utils' + +on: + push: + branches: + - 'main' + paths: + - 'docker/terraform-utils/Dockerfile' + +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/terraform-utils/ + tags: maddevsio/terraform-utils:latest diff --git a/docker/aws-eks-utils/Dockerfile b/docker/aws-eks-utils/Dockerfile index 8409b1e6..f73420b0 100644 --- a/docker/aws-eks-utils/Dockerfile +++ b/docker/aws-eks-utils/Dockerfile @@ -1,9 +1,10 @@ -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" +FROM alpine:3.13.5 + +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 +14,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 +51,14 @@ 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..d18b701f --- /dev/null +++ b/docker/terraform-utils/Dockerfile @@ -0,0 +1,18 @@ +FROM alpine:3.13.5 +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 [""]