Skip to content

Feature/terraform utils #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/aws-eks-utils-image.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 4 additions & 3 deletions .github/workflows/terraform-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -36,21 +36,22 @@ 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:
- name: Checkout
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:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/terraform-utils-image.yml
Original file line number Diff line number Diff line change
@@ -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
20 changes: 10 additions & 10 deletions docker/aws-eks-utils/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"

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"

Expand All @@ -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

Expand Down Expand Up @@ -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 [""]
18 changes: 18 additions & 0 deletions docker/terraform-utils/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 [""]