Skip to content

Commit 4b5613a

Browse files
committed
upgrade terrafomr to 0.13
1 parent 4c5ce5d commit 4b5613a

File tree

9 files changed

+681
-285
lines changed

9 files changed

+681
-285
lines changed

.github/workflows/readme.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: 'Create README.md file'
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
readme-create:
9+
name: 'readme-create'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: 'Checkout'
13+
uses: actions/checkout@master
14+
15+
- name: Set up Python 3.7.
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: '3.x'
19+
20+
- name: 'Install test dependencies.'
21+
run: pip install yamllint
22+
23+
- name: Run yamllint.
24+
run: yamllint ./README.yaml
25+
26+
- name: clone Genie repo
27+
run: |
28+
export GITHUB_ACCESS_TOKEN=${{ secrets.GITHUB }}
29+
cd .. && cd .. && cd ..
30+
git clone https://${{ secrets.GITHUB }}@github.com/clouddrove/genie.git
31+
cd /home/runner/work/terraform-aws-security-group/terraform-aws-security-group
32+
make packages/install/gomplate
33+
make readme
34+
- name: push to repo back
35+
run: |
36+
git config --global user.email "anmol@clouddrove.com"
37+
git config --global user.name "Anmol nagpal"
38+
git add . && git commit -m "upload"
39+
git push origin master
40+
41+
- name: 'Slack Notification'
42+
uses: clouddrove/action-slack@v2
43+
with:
44+
status: ${{ job.status }}
45+
fields: repo,author
46+
author_name: 'Clouddrove'
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
49+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
50+
if: always()

.github/workflows/terraform.yml

Lines changed: 61 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,98 @@
11
name: 'Terraform GitHub Actions'
22
on:
3-
- pull_request
3+
- push
44

55
jobs:
66
terraform:
77
name: 'Terraform'
88
runs-on: ubuntu-latest
99
steps:
10-
1110
- name: 'Checkout'
1211
uses: actions/checkout@master
1312

14-
- name: 'Terraform Format'
15-
uses: clouddrove/github-actions@v2.0
16-
with:
17-
actions_subcommand: 'fmt'
18-
19-
- name: 'Terraform Init for memcached'
20-
uses: clouddrove/github-actions@v2.0
13+
- name: 'Terraform Format fmt memcached'
14+
uses: hashicorp/terraform-github-actions@master
2115
with:
22-
actions_subcommand: 'init'
23-
tf_actions_working_dir: ./_example/memcached
16+
tf_actions_version: 0.13.4
17+
tf_actions_subcommand: 'fmt'
18+
tf_actions_working_dir: "./_example/memcached"
19+
tf_actions_comment: true
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2422

25-
- name: 'Terraform Init Redis'
26-
uses: clouddrove/github-actions@v2.0
23+
- name: 'Terraform Format fmt redis'
24+
uses: hashicorp/terraform-github-actions@master
2725
with:
28-
actions_subcommand: 'init'
29-
tf_actions_working_dir: ./_example/redis
26+
tf_actions_version: 0.13.4
27+
tf_actions_subcommand: 'fmt'
28+
tf_actions_working_dir: "./_example/redis"
29+
tf_actions_comment: true
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3032

31-
- name: 'Terraform Init For Redis Cluster'
32-
uses: clouddrove/github-actions@v2.0
33+
- name: 'Terraform Format fmt redis-cluster'
34+
uses: hashicorp/terraform-github-actions@master
3335
with:
34-
actions_subcommand: 'init'
35-
tf_actions_working_dir: ./_example/redis-cluster
36+
tf_actions_version: 0.13.4
37+
tf_actions_subcommand: 'fmt'
38+
tf_actions_working_dir: "./_example/redis-cluster"
39+
tf_actions_comment: true
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3642

3743
- name: Configure AWS Credentials
3844
uses: clouddrove/configure-aws-credentials@v1
3945
with:
40-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
41-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
46+
aws-access-key-id: ${{ secrets.TEST_AWS_ACCESS_KEY }}
47+
aws-secret-access-key: ${{ secrets.TEST_AWS_ACCESS_SECRET_KEY }}
4248
aws-region: us-east-2
4349

44-
- name: 'Terraform Plan for memcached'
45-
uses: clouddrove/github-actions@v2.0
50+
- name: Set up Go 1.13
51+
uses: actions/setup-go@v1
4652
with:
47-
actions_subcommand: 'plan'
48-
tf_actions_working_dir: ./_example/memcached
49-
env:
50-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
go-version: 1.13
54+
id: go
5155

52-
- name: 'Terraform Plan for Redis'
53-
uses: clouddrove/github-actions@v2.0
54-
with:
55-
actions_subcommand: 'plan'
56-
tf_actions_working_dir: ./_example/redis
57-
env:
58-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
- name: Get dependencies
57+
run: |
58+
if [ -f Gopkg.toml ]; then
59+
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
60+
dep ensure
61+
else
62+
go get -v -t -d ./...
63+
fi
5964
60-
- name: 'Terraform Plan For Redis Cluster'
61-
uses: clouddrove/github-actions@v2.0
62-
with:
63-
actions_subcommand: 'plan'
64-
tf_actions_working_dir: ./_example/redis-cluster
65-
env:
66-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
- name: Test redis-cluster'
66+
working-directory: ./_test/redis-cluster
67+
run: go test --timeout 1500000m
6768

68-
- name: 'Terratest For Memcached'
69-
uses: clouddrove/github-actions@v2.0
69+
- name: 'Terraform Init memcached'
70+
uses: hashicorp/terraform-github-actions@master
7071
with:
71-
actions_subcommand: 'terratest'
72-
tf_actions_working_dir: ./_test/memcached
72+
tf_actions_version: 0.13.4
73+
tf_actions_subcommand: 'init'
74+
tf_actions_working_dir: "./_example/memcached"
75+
tf_actions_comment: true
7376
env:
7477
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7578

76-
- name: 'Terratest For Redis'
77-
uses: clouddrove/github-actions@v2.0
79+
- name: 'Terraform Init redis-cluster'
80+
uses: hashicorp/terraform-github-actions@master
7881
with:
79-
actions_subcommand: 'terratest'
80-
tf_actions_working_dir: ./_test/redis
82+
tf_actions_version: 0.13.4
83+
tf_actions_subcommand: 'init'
84+
tf_actions_working_dir: "./_example/redis-cluster"
85+
tf_actions_comment: true
8186
env:
8287
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8388

84-
- name: 'Terratest For Redis Cluster'
85-
uses: clouddrove/github-actions@v2.0
89+
- name: 'Terraform Init redis'
90+
uses: hashicorp/terraform-github-actions@master
8691
with:
87-
actions_subcommand: 'terratest'
88-
tf_actions_working_dir: ./_test/redis-cluster
92+
tf_actions_version: 0.13.4
93+
tf_actions_subcommand: 'init'
94+
tf_actions_working_dir: "./_example/redis"
95+
tf_actions_comment: true
8996
env:
9097
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9198

@@ -97,5 +104,5 @@ jobs:
97104
author_name: 'Clouddrove'
98105
env:
99106
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
100-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required
107+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
101108
if: always()

0 commit comments

Comments
 (0)