From 30e249d460a02e4735ee803363039e81a20e8f0d Mon Sep 17 00:00:00 2001 From: Prakash Date: Wed, 20 May 2020 12:44:45 +0530 Subject: [PATCH 1/5] github action --- .github/workflows/terraform.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .github/workflows/terraform.yml diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml new file mode 100644 index 0000000..e69de29 From c683a5b6a02d67cd95b1e25c890f2b7f3bd3bb72 Mon Sep 17 00:00:00 2001 From: Prakash Date: Thu, 21 May 2020 12:23:04 +0530 Subject: [PATCH 2/5] github action --- .github/workflows/terraform.yml | 57 +++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index e69de29..d3bb664 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -0,0 +1,57 @@ +name: 'Terraform GitHub Actions' +on: + - pull_request + +jobs: + terraform: + name: 'Terraform' + runs-on: ubuntu-latest + steps: + + - name: 'Checkout' + uses: actions/checkout@master + + - name: 'Terraform Format' + uses: clouddrove/github-actions@v2.0 + with: + actions_subcommand: 'fmt' + + - name: 'Terraform Init' + uses: clouddrove/github-actions@v2.0 + with: + actions_subcommand: 'init' + tf_actions_working_dir: ./_example + + - name: Configure AWS Credentials + uses: clouddrove/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-2 + + - name: 'Terraform Plan' + uses: clouddrove/github-actions@v2.0 + with: + actions_subcommand: 'plan' + tf_actions_working_dir: ./_example/ + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: 'Terratest' + uses: clouddrove/github-actions@v2.0 + with: + actions_subcommand: 'terratest' + tf_actions_working_dir: ./_test + 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 }} # required + if: always() From a0d0fe3b7b44efccb66a873741b5ddf9a4c345e8 Mon Sep 17 00:00:00 2001 From: Prakash Date: Thu, 21 May 2020 12:28:05 +0530 Subject: [PATCH 3/5] github action --- .github/workflows/terraform.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index d3bb664..65feaf5 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -23,8 +23,8 @@ jobs: tf_actions_working_dir: ./_example - name: Configure AWS Credentials - uses: clouddrove/configure-aws-credentials@v1 - with: + uses: clouddrove/configure-aws-credentials@v1 + with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-east-2 From 51f81b9303de57a4e55a63e509acae17841b09d3 Mon Sep 17 00:00:00 2001 From: Prakash Date: Thu, 21 May 2020 12:31:42 +0530 Subject: [PATCH 4/5] github action --- _test/labels_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_test/labels_test.go b/_test/labels_test.go index a1fa19e..0f1632d 100644 --- a/_test/labels_test.go +++ b/_test/labels_test.go @@ -31,4 +31,5 @@ func Test(t *testing.T) { // Check that we get back the outputs that we expect assert.Equal(t, "labels-clouddrove-test", Tags["Name"]) assert.Equal(t, "labels-clouddrove-test", Id) -} \ No newline at end of file +} + From 30f08a2da93581350ef2813fcf97e24ae77bf82d Mon Sep 17 00:00:00 2001 From: Prakash Date: Thu, 21 May 2020 21:26:18 +0530 Subject: [PATCH 5/5] terratest --- .github/workflows/terraform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 65feaf5..a6ad409 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -33,7 +33,7 @@ jobs: uses: clouddrove/github-actions@v2.0 with: actions_subcommand: 'plan' - tf_actions_working_dir: ./_example/ + tf_actions_working_dir: ./_example env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}