Skip to content

Commit

Permalink
Merge pull request #2 from ToruMakabe/dev
Browse files Browse the repository at this point in the history
Refactor: v2.0.0
  • Loading branch information
torumakabe authored Mar 9, 2022
2 parents e4504e4 + 103ffe5 commit cb07ba6
Show file tree
Hide file tree
Showing 105 changed files with 2,633 additions and 1,972 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-flux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
echo "::set-output name=DIFF_LOG::$DIFF_LOG"
- name: "Create comment for PR (diff flux files between Blue & Green)"
uses: actions/github-script@v4
uses: actions/github-script@v5
env:
DIFF: "${{ steps.diff.outputs.DIFF_LOG }}"
with:
Expand All @@ -51,7 +51,7 @@ jobs:
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;
github.issues.createComment({
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down
39 changes: 18 additions & 21 deletions .github/workflows/ci-terraform-blue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
echo "::set-output name=DIFF_LOG::$DIFF_LOG"
- name: "Create comment for PR (diff Terraform files between Blue & Green)"
uses: actions/github-script@v4
uses: actions/github-script@v5
env:
DIFF: "${{ steps.diff.outputs.DIFF_LOG }}"
with:
Expand All @@ -56,7 +56,7 @@ jobs:
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;
github.issues.createComment({
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
Expand All @@ -66,46 +66,42 @@ jobs:
- name: "Setup Terraform"
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.0.9
terraform_version: 1.1.7

- name: "Terraform Format"
id: fmt
working-directory: ./terraform/blue
run: terraform fmt -check
working-directory: ./test/integration
run: make format-check-blue

- name: "Terraform Init"
id: init
working-directory: ./test/fixtures/blue
run: terraform init -backend=false
working-directory: ./test/integration
run: make init-blue

- name: "Setup TFLint"
uses: terraform-linters/setup-tflint@v1
with:
tflint_version: v0.32.1

- name: "Init TFLint"
working-directory: "./test/fixtures/blue"
run: tflint --init
tflint_version: v0.34.1

- name: "Run TFLint"
id: tflint
working-directory: "./test/fixtures/blue"
run: tflint -f compact --module --var-file=ci.tfvars
working-directory: ./test/integration
run: make lint-blue
# Exit this job if tflint fails

- name: "Terraform Validate"
id: validate
working-directory: ./test/fixtures/blue
run: terraform validate -no-color
working-directory: ./test/integration
run: make validate-blue

- name: "Terraform Plan"
id: plan
working-directory: ./test/fixtures/blue
run: terraform plan -var-file=ci.tfvars -no-color
working-directory: ./test/integration
run: make plan-blue
continue-on-error: true

- name: "Create comment for PR (Terraform fmt/validate/plan)"
uses: actions/github-script@v4
- name: "Create comment for PR (Terraform fmt/init/validate/plan)"
uses: actions/github-script@v5
env:
PLAN: "${{ steps.plan.outputs.stdout }}\n${{ steps.plan.outputs.stderr }}"
with:
Expand All @@ -114,6 +110,7 @@ jobs:
const output = `#### Check Terraform files (Blue)
#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\`
#### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\`
#### TFLint 👓\`${{ steps.tflint.outcome }}\`
#### Terraform Validation 🤖\`${{ steps.validate.outcome }}\`
#### Terraform Plan 📖\`${{ steps.plan.outcome }}\`
Expand All @@ -129,7 +126,7 @@ jobs:
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;
github.issues.createComment({
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down
39 changes: 18 additions & 21 deletions .github/workflows/ci-terraform-green.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
echo "::set-output name=DIFF_LOG::$DIFF_LOG"
- name: "Create comment for PR (diff Terraform files between Blue & Green)"
uses: actions/github-script@v4
uses: actions/github-script@v5
env:
DIFF: "${{ steps.diff.outputs.DIFF_LOG }}"
with:
Expand All @@ -56,7 +56,7 @@ jobs:
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;
github.issues.createComment({
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
Expand All @@ -66,46 +66,42 @@ jobs:
- name: "Setup Terraform"
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.0.9
terraform_version: 1.1.7

- name: "Terraform Format"
id: fmt
working-directory: ./terraform/green
run: terraform fmt -check
working-directory: ./test/integration
run: make format-check-green

- name: "Terraform Init"
id: init
working-directory: ./test/fixtures/green
run: terraform init -backend=false
working-directory: ./test/integration
run: make init-green

- name: "Setup TFLint"
uses: terraform-linters/setup-tflint@v1
with:
tflint_version: v0.32.1

- name: "Init TFLint"
working-directory: "./test/fixtures/green"
run: tflint --init
tflint_version: v0.34.1

- name: "Run TFLint"
id: tflint
working-directory: "./test/fixtures/green"
run: tflint -f compact --module --var-file=ci.tfvars
working-directory: ./test/integration
run: make lint-green
# Exit this job if tflint fails

- name: "Terraform Validate"
id: validate
working-directory: ./test/fixtures/green
run: terraform validate -no-color
working-directory: ./test/integration
run: make validate-green

- name: "Terraform Plan"
id: plan
working-directory: ./test/fixtures/green
run: terraform plan -var-file=ci.tfvars -no-color
working-directory: ./test/integration
run: make plan-green
continue-on-error: true

- name: "Create comment for PR (Terraform fmt/validate/plan)"
uses: actions/github-script@v4
- name: "Create comment for PR (Terraform fmt/init/validate/plan)"
uses: actions/github-script@v5
env:
PLAN: "${{ steps.plan.outputs.stdout }}\n${{ steps.plan.outputs.stderr }}"
with:
Expand All @@ -114,6 +110,7 @@ jobs:
const output = `#### Check Terraform files (Green)
#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\`
#### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\`
#### TFLint 👓\`${{ steps.tflint.outcome }}\`
#### Terraform Validation 🤖\`${{ steps.validate.outcome }}\`
#### Terraform Plan 📖\`${{ steps.plan.outcome }}\`
Expand All @@ -129,7 +126,7 @@ jobs:
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;
github.issues.createComment({
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down
35 changes: 16 additions & 19 deletions .github/workflows/ci-terraform-shared.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,46 +27,42 @@ jobs:
- name: "Setup Terraform"
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.0.9
terraform_version: 1.1.7

- name: "Terraform Format"
id: fmt
working-directory: ./terraform/shared
run: terraform fmt -check
working-directory: ./test/integration
run: make format-check-shared

- name: "Terraform Init"
id: init
working-directory: ./test/fixtures/shared
run: terraform init -backend=false
working-directory: ./test/integration
run: make init-shared

- name: "Setup TFLint"
uses: terraform-linters/setup-tflint@v1
with:
tflint_version: v0.32.1

- name: "Init TFLint"
working-directory: "./test/fixtures/shared"
run: tflint --init
tflint_version: v0.34.1

- name: "Run TFLint"
id: tflint
working-directory: "./test/fixtures/shared"
run: tflint -f compact --module --var-file=ci.tfvars
working-directory: ./test/integration
run: make lint-shared
# Exit this job if tflint fails

- name: "Terraform Validate"
id: validate
working-directory: ./test/fixtures/shared
run: terraform validate -no-color
working-directory: ./test/integration
run: make validate-shared

- name: "Terraform Plan"
id: plan
working-directory: ./test/fixtures/shared
run: terraform plan -var-file=ci.tfvars -no-color
working-directory: ./test/integration
run: make plan-shared
continue-on-error: true

- name: "Create comment for PR (Terraform fmt/validate/plan)"
uses: actions/github-script@v4
- name: "Create comment for PR (Terraform fmt/init/validate/plan)"
uses: actions/github-script@v5
env:
PLAN: "${{ steps.plan.outputs.stdout }}\n${{ steps.plan.outputs.stderr }}"
with:
Expand All @@ -75,6 +71,7 @@ jobs:
const output = `#### Check Terraform files (Shared)
#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\`
#### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\`
#### TFLint 👓\`${{ steps.tflint.outcome }}\`
#### Terraform Validation 🤖\`${{ steps.validate.outcome }}\`
#### Terraform Plan 📖\`${{ steps.plan.outcome }}\`
Expand All @@ -90,7 +87,7 @@ jobs:
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;
github.issues.createComment({
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down
Loading

0 comments on commit cb07ba6

Please sign in to comment.