Skip to content

Commit

Permalink
fixed ci.
Browse files Browse the repository at this point in the history
  • Loading branch information
y-miyazaki committed Jun 7, 2023
1 parent 8fe3781 commit 47cc190
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ci-push-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# https://help.github.com/ja/actions/reference/workflow-syntax-for-github-actions
name: ci-push-dev
on:
push:
branches:
- "feature/**"
- "develop"
jobs:
integration:
environment:
name: dev
env:
ENV: ${{ secrets.ENV }}
runs-on: ubuntu-latest
steps:
- name: "code: check out code"
uses: actions/checkout@v2
- name: "parameters: set parameters"
id: parameters
run: |
PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
echo "::set-output name=pr_number::${PR_NUMBER}"
- name: "terraform: check"
run: |
echo "$ENV" >> $PWD/.env
find scripts -type f -name '*.sh' -exec chmod +x \{\} \;
docker pull ghcr.io/y-miyazaki/terraform-aws-debian:latest
docker run --rm -v $PWD:/workspace --env-file=$PWD/.env -w /workspace --name terraform-aws ghcr.io/y-miyazaki/terraform-aws-debian:latest scripts/terraform/integration_push.sh terraform/base
docker run --rm -v $PWD:/workspace --env-file=$PWD/.env -w /workspace --name terraform-aws ghcr.io/y-miyazaki/terraform-aws-debian:latest scripts/terraform/integration_push.sh terraform/monitor
- name: "slack: notification for failed build."
if: failure()
uses: rtCamp/[email protected]
env:
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL_ID }}
SLACK_COLOR: "danger"
SLACK_ICON: ""
SLACK_TITLE: failed dev build(terraform-aws-base)
SLACK_USERNAME: github-notification
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
2 changes: 1 addition & 1 deletion scripts/terraform/example/integration_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ tfsec --tfvars-file terraform."${ENV}".tfvars
# echo "#--------------------------------------------------------------"
# echo "# terraform plan ($PWD)"
# echo "#--------------------------------------------------------------"
# terraform plan -lock=false -no-color -var-file=terraform."${ENV}".tfvars
terraform plan -lock=false -no-color -var-file=terraform."${ENV}".tfvars
5 changes: 3 additions & 2 deletions scripts/terraform/integration_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ echo "#--------------------------------------------------------------"
echo "# terraform init ($PWD)"
echo "#--------------------------------------------------------------"
# terraform init -reconfigure -backend-config=terraform."${ENV}".tfbackend
terraform init
# terraform init
echo "#--------------------------------------------------------------"
echo "# tflint ($PWD)"
echo "#--------------------------------------------------------------"
tflint --module
echo "#--------------------------------------------------------------"
echo "# tfsec ($PWD)"
echo "#--------------------------------------------------------------"
tfsec --tfvars-file terraform."${ENV}".tfvars
# tfsec --tfvars-file terraform."${ENV}".tfvars
tfsec --tfvars-file terraform.example.tfvars
# echo "#--------------------------------------------------------------"
# echo "# terraform plan ($PWD)"
# echo "#--------------------------------------------------------------"
Expand Down

0 comments on commit 47cc190

Please sign in to comment.