Skip to content

Commit

Permalink
Upgrade terraform versionn to 0.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dhyanio committed Oct 19, 2020
1 parent 2076065 commit 44454c9
Show file tree
Hide file tree
Showing 8 changed files with 353 additions and 67 deletions.
47 changes: 25 additions & 22 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,37 @@ jobs:
with:
python-version: '3.x'

- name: 'Install test dependencies.'
run: pip install yamllint

- name: Run yamllint.
run: yamllint ./README.yaml

- name: clone Genie repo
run: |
export GITHUB_ACCESS_TOKEN=${{ secrets.GITHUB }}
cd .. && cd .. && cd ..
git clone https://${{ secrets.GITHUB }}@github.com/clouddrove/genie.git
cd /home/runner/work/terraform-aws-security-group/terraform-aws-security-group
make packages/install/gomplate
make readme
- name: push to repo back
run: |
git config --global user.email "anmol@clouddrove.com"
git config --global user.name "Anmol nagpal"
git add . && git commit -m "upload"
git push origin master
- name: 'create readme'
uses: 'clouddrove/github-actions@v4.0'
with:
actions_subcommand: 'readme'
github_token: '${{ secrets.GITHUB}}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}


- name: pre-commit check errors
uses: pre-commit/action@v2.0.0
continue-on-error: true

- name: pre-commit fix erros
uses: pre-commit/action@v2.0.0
continue-on-error: true

- name: 'push readme'
uses: 'clouddrove/github-actions@v4.0'
continue-on-error: true
with:
actions_subcommand: 'push'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}

- name: 'Slack Notification'
uses: clouddrove/action-slack@v2
with:
status: ${{ job.status }}
fields: repo,author
author_name: 'Clouddrove'
author_name: 'CloudDrove'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
Expand Down
56 changes: 21 additions & 35 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: 'Terraform GitHub Actions'
on:
- push
pull_request:
branches:
- master

jobs:
terraform:
Expand All @@ -10,58 +12,42 @@ jobs:
- name: 'Checkout'
uses: actions/checkout@master

- name: 'Terraform Format fmt'
uses: hashicorp/terraform-github-actions@master
with:
tf_actions_version: 0.13.4
tf_actions_subcommand: 'fmt'
tf_actions_working_dir: "./_example/default-s3"
tf_actions_comment: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Configure AWS Credentials
uses: clouddrove/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.TEST_AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.TEST_AWS_ACCESS_SECRET_KEY }}
aws-region: us-east-2

- name: Set up Go 1.13
uses: actions/setup-go@v1
- name: 'Terraform Format'
uses: 'clouddrove/github-actions@v4.0'
with:
go-version: 1.13
id: go
actions_subcommand: 'fmt'

- name: Get dependencies
run: |
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
else
go get -v -t -d ./...
fi
- name: 'Terraform init'
uses: 'clouddrove/github-actions@v4.0'
with:
actions_subcommand: 'init'
tf_actions_working_dir: ./_example/default-s3

- name: Test
working-directory: ./_test/default-s3
run: go test
- name: 'Terraform validate'
uses: 'clouddrove/github-actions@v4.0'
with:
actions_subcommand: 'validate'
tf_actions_working_dir: ./_example/default-s3

- name: 'Terraform Init'
uses: hashicorp/terraform-github-actions@master
- name: 'Terraform plan'
uses: 'clouddrove/github-actions@v4.0'
with:
tf_actions_version: 0.13.4
tf_actions_subcommand: 'init'
tf_actions_working_dir: "./_example/default-s3"
tf_actions_comment: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
actions_subcommand: 'plan'
tf_actions_working_dir: ./_example/default-s3

- name: 'Slack Notification'
uses: clouddrove/action-slack@v2
with:
status: ${{ job.status }}
fields: repo,author
author_name: 'Clouddrove'
author_name: 'CloudDrove'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/terratest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: 'Terratest GitHub Actions'
on:
pull_request:
branches:
- master
types: [labeled]

jobs:
terraform:
name: 'Terraform'
runs-on: ubuntu-latest
steps:

- name: 'Checkout'
uses: actions/checkout@master

- name: Configure AWS Credentials
uses: clouddrove/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.TEST_AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.TEST_AWS_ACCESS_SECRET_KEY }}
aws-region: us-east-2

- name: 'Terratest'
if: ${{ github.event.label.name == 'terratest' }}
uses: 'clouddrove/github-actions@v4.0'
with:
actions_subcommand: 'terratest'
tf_actions_working_dir: ./_test/default-s3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'Slack Notification'
uses: clouddrove/action-slack@v2
with:
status: ${{ job.status }}
fields: repo,author
author_name: 'CloudDrove'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
if: always()
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
repos:
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.12.0
rev: v1.43.0
hooks:
- id: terraform_fmt

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0
rev: v3.2.0
hooks:
- id: check-merge-conflict
- id: trailing-whitespace
- id: check-yaml
- id: check-added-large-files
- id: trailing-whitespace
Loading

0 comments on commit 44454c9

Please sign in to comment.