diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml new file mode 100644 index 00000000000..5112487317d --- /dev/null +++ b/.github/workflows/bench.yml @@ -0,0 +1,204 @@ +--- +name: bench +on: + push: + branches: + - main + paths: + - 'terraform/environments/bench/**' + - '.github/workflows/bench.yml' + pull_request: + branches: + - main + types: [opened, edited, reopened, synchronize] + paths: + - 'terraform/environments/bench/**' + - '.github/workflows/bench.yml' + workflow_dispatch: +env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + TF_IN_AUTOMATION: true +defaults: + run: + shell: bash + +jobs: + + # These jobs run when creating a pull request + plan-development: + name: Plan Development - bench + runs-on: ubuntu-latest + if: github.ref != 'refs/heads/main' + steps: + - name: Checkout Repository + uses: actions/checkout@v2.3.4 + - name: Load and Configure Terraform + uses: hashicorp/setup-terraform@v1.3.2 + with: + terraform_version: 0.14.6 + terraform_wrapper: false + - name: Terraform plan - development + run: | + echo "Terraform plan - ${TF_ENV}" + bash scripts/terraform-init.sh terraform/environments/bench + terraform -chdir="terraform/environments/bench" workspace select "bench-${TF_ENV}" + bash scripts/terraform-plan.sh terraform/environments/bench + env: + TF_ENV: development + + deploy-development: + name: Deploy Development - bench + runs-on: ubuntu-latest + if: github.ref != 'refs/heads/main' + environment: + name: bench-development + steps: + - name: Checkout Repository + uses: actions/checkout@v2.3.4 + - name: Load and Configure Terraform + uses: hashicorp/setup-terraform@v1.3.2 + with: + terraform_version: 0.14.6 + terraform_wrapper: false + - name: Terraform apply - development + run: | + echo "Terraform apply - ${TF_ENV}" + bash scripts/terraform-init.sh terraform/environments/bench + terraform -chdir="terraform/environments/bench" workspace select "bench-${TF_ENV}" + bash scripts/terraform-apply.sh terraform/environments/bench + env: + TF_ENV: development + + # plan-test: + # name: Plan Test - bench + # runs-on: ubuntu-latest + # if: github.ref != 'refs/heads/main' + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform plan - test + # run: | + # echo "Terraform plan - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/bench + # terraform -chdir="terraform/environments/bench" workspace select "bench-${TF_ENV}" + # bash scripts/terraform-plan.sh terraform/environments/bench + # env: + # TF_ENV: test + + # deploy-test: + # name: Deploy Test - bench + # runs-on: ubuntu-latest + # if: github.ref != 'refs/heads/main' + # environment: + # name: bench-test + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform apply - test + # run: | + # echo "Terraform apply - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/bench + # terraform -chdir="terraform/environments/bench" workspace select "bench-${TF_ENV}" + # bash scripts/terraform-apply.sh terraform/environments/bench + # env: + # TF_ENV: test + + # # These jobs run after merging to main + # plan-preproduction: + # name: Plan Preproduction - bench + # runs-on: ubuntu-latest + # if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform plan - preproduction + # run: | + # echo "Terraform plan - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/bench + # terraform -chdir="terraform/environments/bench" workspace select "bench-${TF_ENV}" + # bash scripts/terraform-plan.sh terraform/environments/bench + # env: + # TF_ENV: preproduction + + # deploy-preproduction: + # name: Deploy Preproduction - bench + # runs-on: ubuntu-latest + # if: github.ref == 'refs/heads/main' + # environment: + # name: bench-preproduction + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform apply - preproduction + # run: | + # echo "Terraform apply - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/bench + # terraform -chdir="terraform/environments/bench" workspace select "bench-${TF_ENV}" + # bash scripts/terraform-apply.sh terraform/environments/bench + # env: + # TF_ENV: preproduction + + plan-production: + name: Plan Production - bench + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + steps: + - name: Checkout Repository + uses: actions/checkout@v2.3.4 + - name: Load and Configure Terraform + uses: hashicorp/setup-terraform@v1.3.2 + with: + terraform_version: 0.14.6 + terraform_wrapper: false + - name: Terraform plan - production + run: | + echo "Terraform plan - ${TF_ENV}" + bash scripts/terraform-init.sh terraform/environments/bench + terraform -chdir="terraform/environments/bench" workspace select "bench-${TF_ENV}" + bash scripts/terraform-plan.sh terraform/environments/bench + env: + TF_ENV: production + + deploy-production: + name: Deploy Production - bench + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + environment: + name: bench-production + steps: + - name: Checkout Repository + uses: actions/checkout@v2.3.4 + - name: Load and Configure Terraform + uses: hashicorp/setup-terraform@v1.3.2 + with: + terraform_version: 0.14.6 + terraform_wrapper: false + - name: Terraform apply - production + run: | + echo "Terraform apply - ${TF_ENV}" + bash scripts/terraform-init.sh terraform/environments/bench + terraform -chdir="terraform/environments/bench" workspace select "bench-${TF_ENV}" + bash scripts/terraform-apply.sh terraform/environments/bench + env: + TF_ENV: production diff --git a/.github/workflows/heater.yml b/.github/workflows/heater.yml new file mode 100644 index 00000000000..4383fa97cb8 --- /dev/null +++ b/.github/workflows/heater.yml @@ -0,0 +1,204 @@ +--- +name: heater +on: + push: + branches: + - main + paths: + - 'terraform/environments/heater/**' + - '.github/workflows/heater.yml' + pull_request: + branches: + - main + types: [opened, edited, reopened, synchronize] + paths: + - 'terraform/environments/heater/**' + - '.github/workflows/heater.yml' + workflow_dispatch: +env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + TF_IN_AUTOMATION: true +defaults: + run: + shell: bash + +jobs: + + # These jobs run when creating a pull request + plan-development: + name: Plan Development - heater + runs-on: ubuntu-latest + if: github.ref != 'refs/heads/main' + steps: + - name: Checkout Repository + uses: actions/checkout@v2.3.4 + - name: Load and Configure Terraform + uses: hashicorp/setup-terraform@v1.3.2 + with: + terraform_version: 0.14.6 + terraform_wrapper: false + - name: Terraform plan - development + run: | + echo "Terraform plan - ${TF_ENV}" + bash scripts/terraform-init.sh terraform/environments/heater + terraform -chdir="terraform/environments/heater" workspace select "heater-${TF_ENV}" + bash scripts/terraform-plan.sh terraform/environments/heater + env: + TF_ENV: development + + deploy-development: + name: Deploy Development - heater + runs-on: ubuntu-latest + if: github.ref != 'refs/heads/main' + environment: + name: heater-development + steps: + - name: Checkout Repository + uses: actions/checkout@v2.3.4 + - name: Load and Configure Terraform + uses: hashicorp/setup-terraform@v1.3.2 + with: + terraform_version: 0.14.6 + terraform_wrapper: false + - name: Terraform apply - development + run: | + echo "Terraform apply - ${TF_ENV}" + bash scripts/terraform-init.sh terraform/environments/heater + terraform -chdir="terraform/environments/heater" workspace select "heater-${TF_ENV}" + bash scripts/terraform-apply.sh terraform/environments/heater + env: + TF_ENV: development + + # plan-test: + # name: Plan Test - heater + # runs-on: ubuntu-latest + # if: github.ref != 'refs/heads/main' + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform plan - test + # run: | + # echo "Terraform plan - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/heater + # terraform -chdir="terraform/environments/heater" workspace select "heater-${TF_ENV}" + # bash scripts/terraform-plan.sh terraform/environments/heater + # env: + # TF_ENV: test + + # deploy-test: + # name: Deploy Test - heater + # runs-on: ubuntu-latest + # if: github.ref != 'refs/heads/main' + # environment: + # name: heater-test + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform apply - test + # run: | + # echo "Terraform apply - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/heater + # terraform -chdir="terraform/environments/heater" workspace select "heater-${TF_ENV}" + # bash scripts/terraform-apply.sh terraform/environments/heater + # env: + # TF_ENV: test + + # # These jobs run after merging to main + # plan-preproduction: + # name: Plan Preproduction - heater + # runs-on: ubuntu-latest + # if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform plan - preproduction + # run: | + # echo "Terraform plan - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/heater + # terraform -chdir="terraform/environments/heater" workspace select "heater-${TF_ENV}" + # bash scripts/terraform-plan.sh terraform/environments/heater + # env: + # TF_ENV: preproduction + + # deploy-preproduction: + # name: Deploy Preproduction - heater + # runs-on: ubuntu-latest + # if: github.ref == 'refs/heads/main' + # environment: + # name: heater-preproduction + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform apply - preproduction + # run: | + # echo "Terraform apply - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/heater + # terraform -chdir="terraform/environments/heater" workspace select "heater-${TF_ENV}" + # bash scripts/terraform-apply.sh terraform/environments/heater + # env: + # TF_ENV: preproduction + + plan-production: + name: Plan Production - heater + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + steps: + - name: Checkout Repository + uses: actions/checkout@v2.3.4 + - name: Load and Configure Terraform + uses: hashicorp/setup-terraform@v1.3.2 + with: + terraform_version: 0.14.6 + terraform_wrapper: false + - name: Terraform plan - production + run: | + echo "Terraform plan - ${TF_ENV}" + bash scripts/terraform-init.sh terraform/environments/heater + terraform -chdir="terraform/environments/heater" workspace select "heater-${TF_ENV}" + bash scripts/terraform-plan.sh terraform/environments/heater + env: + TF_ENV: production + + deploy-production: + name: Deploy Production - heater + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + environment: + name: heater-production + steps: + - name: Checkout Repository + uses: actions/checkout@v2.3.4 + - name: Load and Configure Terraform + uses: hashicorp/setup-terraform@v1.3.2 + with: + terraform_version: 0.14.6 + terraform_wrapper: false + - name: Terraform apply - production + run: | + echo "Terraform apply - ${TF_ENV}" + bash scripts/terraform-init.sh terraform/environments/heater + terraform -chdir="terraform/environments/heater" workspace select "heater-${TF_ENV}" + bash scripts/terraform-apply.sh terraform/environments/heater + env: + TF_ENV: production diff --git a/.github/workflows/ops-engineering.yml b/.github/workflows/ops-engineering.yml new file mode 100644 index 00000000000..5f03356240c --- /dev/null +++ b/.github/workflows/ops-engineering.yml @@ -0,0 +1,204 @@ +--- +name: ops-engineering +on: + push: + branches: + - main + paths: + - 'terraform/environments/ops-engineering/**' + - '.github/workflows/ops-engineering.yml' + pull_request: + branches: + - main + types: [opened, edited, reopened, synchronize] + paths: + - 'terraform/environments/ops-engineering/**' + - '.github/workflows/ops-engineering.yml' + workflow_dispatch: +env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + TF_IN_AUTOMATION: true +defaults: + run: + shell: bash + +jobs: + + # These jobs run when creating a pull request + plan-development: + name: Plan Development - ops-engineering + runs-on: ubuntu-latest + if: github.ref != 'refs/heads/main' + steps: + - name: Checkout Repository + uses: actions/checkout@v2.3.4 + - name: Load and Configure Terraform + uses: hashicorp/setup-terraform@v1.3.2 + with: + terraform_version: 0.14.6 + terraform_wrapper: false + - name: Terraform plan - development + run: | + echo "Terraform plan - ${TF_ENV}" + bash scripts/terraform-init.sh terraform/environments/ops-engineering + terraform -chdir="terraform/environments/ops-engineering" workspace select "ops-engineering-${TF_ENV}" + bash scripts/terraform-plan.sh terraform/environments/ops-engineering + env: + TF_ENV: development + + deploy-development: + name: Deploy Development - ops-engineering + runs-on: ubuntu-latest + if: github.ref != 'refs/heads/main' + environment: + name: ops-engineering-development + steps: + - name: Checkout Repository + uses: actions/checkout@v2.3.4 + - name: Load and Configure Terraform + uses: hashicorp/setup-terraform@v1.3.2 + with: + terraform_version: 0.14.6 + terraform_wrapper: false + - name: Terraform apply - development + run: | + echo "Terraform apply - ${TF_ENV}" + bash scripts/terraform-init.sh terraform/environments/ops-engineering + terraform -chdir="terraform/environments/ops-engineering" workspace select "ops-engineering-${TF_ENV}" + bash scripts/terraform-apply.sh terraform/environments/ops-engineering + env: + TF_ENV: development + + # plan-test: + # name: Plan Test - ops-engineering + # runs-on: ubuntu-latest + # if: github.ref != 'refs/heads/main' + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform plan - test + # run: | + # echo "Terraform plan - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/ops-engineering + # terraform -chdir="terraform/environments/ops-engineering" workspace select "ops-engineering-${TF_ENV}" + # bash scripts/terraform-plan.sh terraform/environments/ops-engineering + # env: + # TF_ENV: test + + # deploy-test: + # name: Deploy Test - ops-engineering + # runs-on: ubuntu-latest + # if: github.ref != 'refs/heads/main' + # environment: + # name: ops-engineering-test + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform apply - test + # run: | + # echo "Terraform apply - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/ops-engineering + # terraform -chdir="terraform/environments/ops-engineering" workspace select "ops-engineering-${TF_ENV}" + # bash scripts/terraform-apply.sh terraform/environments/ops-engineering + # env: + # TF_ENV: test + + # # These jobs run after merging to main + # plan-preproduction: + # name: Plan Preproduction - ops-engineering + # runs-on: ubuntu-latest + # if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform plan - preproduction + # run: | + # echo "Terraform plan - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/ops-engineering + # terraform -chdir="terraform/environments/ops-engineering" workspace select "ops-engineering-${TF_ENV}" + # bash scripts/terraform-plan.sh terraform/environments/ops-engineering + # env: + # TF_ENV: preproduction + + # deploy-preproduction: + # name: Deploy Preproduction - ops-engineering + # runs-on: ubuntu-latest + # if: github.ref == 'refs/heads/main' + # environment: + # name: ops-engineering-preproduction + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform apply - preproduction + # run: | + # echo "Terraform apply - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/ops-engineering + # terraform -chdir="terraform/environments/ops-engineering" workspace select "ops-engineering-${TF_ENV}" + # bash scripts/terraform-apply.sh terraform/environments/ops-engineering + # env: + # TF_ENV: preproduction + + # plan-production: + # name: Plan Production - ops-engineering + # runs-on: ubuntu-latest + # if: github.ref == 'refs/heads/main' + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform plan - production + # run: | + # echo "Terraform plan - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/ops-engineering + # terraform -chdir="terraform/environments/ops-engineering" workspace select "ops-engineering-${TF_ENV}" + # bash scripts/terraform-plan.sh terraform/environments/ops-engineering + # env: + # TF_ENV: production + + # deploy-production: + # name: Deploy Production - ops-engineering + # runs-on: ubuntu-latest + # if: github.ref == 'refs/heads/main' + # environment: + # name: ops-engineering-production + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform apply - production + # run: | + # echo "Terraform apply - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/ops-engineering + # terraform -chdir="terraform/environments/ops-engineering" workspace select "ops-engineering-${TF_ENV}" + # bash scripts/terraform-apply.sh terraform/environments/ops-engineering + # env: + # TF_ENV: production diff --git a/.github/workflows/performance-hub.yml b/.github/workflows/performance-hub.yml new file mode 100644 index 00000000000..9056f518d8b --- /dev/null +++ b/.github/workflows/performance-hub.yml @@ -0,0 +1,204 @@ +--- +name: performance-hub +on: + push: + branches: + - main + paths: + - 'terraform/environments/performance-hub/**' + - '.github/workflows/performance-hub.yml' + pull_request: + branches: + - main + types: [opened, edited, reopened, synchronize] + paths: + - 'terraform/environments/performance-hub/**' + - '.github/workflows/performance-hub.yml' + workflow_dispatch: +env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + TF_IN_AUTOMATION: true +defaults: + run: + shell: bash + +jobs: + + # These jobs run when creating a pull request + # plan-development: + # name: Plan Development - performance-hub + # runs-on: ubuntu-latest + # if: github.ref != 'refs/heads/main' + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform plan - development + # run: | + # echo "Terraform plan - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/performance-hub + # terraform -chdir="terraform/environments/performance-hub" workspace select "performance-hub-${TF_ENV}" + # bash scripts/terraform-plan.sh terraform/environments/performance-hub + # env: + # TF_ENV: development + + # deploy-development: + # name: Deploy Development - performance-hub + # runs-on: ubuntu-latest + # if: github.ref != 'refs/heads/main' + # environment: + # name: performance-hub-development + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform apply - development + # run: | + # echo "Terraform apply - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/performance-hub + # terraform -chdir="terraform/environments/performance-hub" workspace select "performance-hub-${TF_ENV}" + # bash scripts/terraform-apply.sh terraform/environments/performance-hub + # env: + # TF_ENV: development + + # plan-test: + # name: Plan Test - performance-hub + # runs-on: ubuntu-latest + # if: github.ref != 'refs/heads/main' + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform plan - test + # run: | + # echo "Terraform plan - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/performance-hub + # terraform -chdir="terraform/environments/performance-hub" workspace select "performance-hub-${TF_ENV}" + # bash scripts/terraform-plan.sh terraform/environments/performance-hub + # env: + # TF_ENV: test + + # deploy-test: + # name: Deploy Test - performance-hub + # runs-on: ubuntu-latest + # if: github.ref != 'refs/heads/main' + # environment: + # name: performance-hub-test + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform apply - test + # run: | + # echo "Terraform apply - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/performance-hub + # terraform -chdir="terraform/environments/performance-hub" workspace select "performance-hub-${TF_ENV}" + # bash scripts/terraform-apply.sh terraform/environments/performance-hub + # env: + # TF_ENV: test + + # These jobs run after merging to main + plan-preproduction: + name: Plan Preproduction - performance-hub + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' + steps: + - name: Checkout Repository + uses: actions/checkout@v2.3.4 + - name: Load and Configure Terraform + uses: hashicorp/setup-terraform@v1.3.2 + with: + terraform_version: 0.14.6 + terraform_wrapper: false + - name: Terraform plan - preproduction + run: | + echo "Terraform plan - ${TF_ENV}" + bash scripts/terraform-init.sh terraform/environments/performance-hub + terraform -chdir="terraform/environments/performance-hub" workspace select "performance-hub-${TF_ENV}" + bash scripts/terraform-plan.sh terraform/environments/performance-hub + env: + TF_ENV: preproduction + + deploy-preproduction: + name: Deploy Preproduction - performance-hub + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + environment: + name: performance-hub-preproduction + steps: + - name: Checkout Repository + uses: actions/checkout@v2.3.4 + - name: Load and Configure Terraform + uses: hashicorp/setup-terraform@v1.3.2 + with: + terraform_version: 0.14.6 + terraform_wrapper: false + - name: Terraform apply - preproduction + run: | + echo "Terraform apply - ${TF_ENV}" + bash scripts/terraform-init.sh terraform/environments/performance-hub + terraform -chdir="terraform/environments/performance-hub" workspace select "performance-hub-${TF_ENV}" + bash scripts/terraform-apply.sh terraform/environments/performance-hub + env: + TF_ENV: preproduction + + # plan-production: + # name: Plan Production - performance-hub + # runs-on: ubuntu-latest + # if: github.ref == 'refs/heads/main' + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform plan - production + # run: | + # echo "Terraform plan - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/performance-hub + # terraform -chdir="terraform/environments/performance-hub" workspace select "performance-hub-${TF_ENV}" + # bash scripts/terraform-plan.sh terraform/environments/performance-hub + # env: + # TF_ENV: production + + # deploy-production: + # name: Deploy Production - performance-hub + # runs-on: ubuntu-latest + # if: github.ref == 'refs/heads/main' + # environment: + # name: performance-hub-production + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform apply - production + # run: | + # echo "Terraform apply - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/performance-hub + # terraform -chdir="terraform/environments/performance-hub" workspace select "performance-hub-${TF_ENV}" + # bash scripts/terraform-apply.sh terraform/environments/performance-hub + # env: + # TF_ENV: production diff --git a/.github/workflows/sprinkler.yml b/.github/workflows/sprinkler.yml new file mode 100644 index 00000000000..5e3274926af --- /dev/null +++ b/.github/workflows/sprinkler.yml @@ -0,0 +1,204 @@ +--- +name: sprinkler +on: + push: + branches: + - main + paths: + - 'terraform/environments/sprinkler/**' + - '.github/workflows/sprinkler.yml' + pull_request: + branches: + - main + types: [opened, edited, reopened, synchronize] + paths: + - 'terraform/environments/sprinkler/**' + - '.github/workflows/sprinkler.yml' + workflow_dispatch: +env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + TF_IN_AUTOMATION: true +defaults: + run: + shell: bash + +jobs: + + # These jobs run when creating a pull request + plan-development: + name: Plan Development - sprinkler + runs-on: ubuntu-latest + if: github.ref != 'refs/heads/main' + steps: + - name: Checkout Repository + uses: actions/checkout@v2.3.4 + - name: Load and Configure Terraform + uses: hashicorp/setup-terraform@v1.3.2 + with: + terraform_version: 0.14.6 + terraform_wrapper: false + - name: Terraform plan - development + run: | + echo "Terraform plan - ${TF_ENV}" + bash scripts/terraform-init.sh terraform/environments/sprinkler + terraform -chdir="terraform/environments/sprinkler" workspace select "sprinkler-${TF_ENV}" + bash scripts/terraform-plan.sh terraform/environments/sprinkler + env: + TF_ENV: development + + deploy-development: + name: Deploy Development - sprinkler + runs-on: ubuntu-latest + if: github.ref != 'refs/heads/main' + environment: + name: sprinkler-development + steps: + - name: Checkout Repository + uses: actions/checkout@v2.3.4 + - name: Load and Configure Terraform + uses: hashicorp/setup-terraform@v1.3.2 + with: + terraform_version: 0.14.6 + terraform_wrapper: false + - name: Terraform apply - development + run: | + echo "Terraform apply - ${TF_ENV}" + bash scripts/terraform-init.sh terraform/environments/sprinkler + terraform -chdir="terraform/environments/sprinkler" workspace select "sprinkler-${TF_ENV}" + bash scripts/terraform-apply.sh terraform/environments/sprinkler + env: + TF_ENV: development + + # plan-test: + # name: Plan Test - sprinkler + # runs-on: ubuntu-latest + # if: github.ref != 'refs/heads/main' + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform plan - test + # run: | + # echo "Terraform plan - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/sprinkler + # terraform -chdir="terraform/environments/sprinkler" workspace select "sprinkler-${TF_ENV}" + # bash scripts/terraform-plan.sh terraform/environments/sprinkler + # env: + # TF_ENV: test + + # deploy-test: + # name: Deploy Test - sprinkler + # runs-on: ubuntu-latest + # if: github.ref != 'refs/heads/main' + # environment: + # name: sprinkler-test + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform apply - test + # run: | + # echo "Terraform apply - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/sprinkler + # terraform -chdir="terraform/environments/sprinkler" workspace select "sprinkler-${TF_ENV}" + # bash scripts/terraform-apply.sh terraform/environments/sprinkler + # env: + # TF_ENV: test + + # # These jobs run after merging to main + # plan-preproduction: + # name: Plan Preproduction - sprinkler + # runs-on: ubuntu-latest + # if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform plan - preproduction + # run: | + # echo "Terraform plan - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/sprinkler + # terraform -chdir="terraform/environments/sprinkler" workspace select "sprinkler-${TF_ENV}" + # bash scripts/terraform-plan.sh terraform/environments/sprinkler + # env: + # TF_ENV: preproduction + + # deploy-preproduction: + # name: Deploy Preproduction - sprinkler + # runs-on: ubuntu-latest + # if: github.ref == 'refs/heads/main' + # environment: + # name: sprinkler-preproduction + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v2.3.4 + # - name: Load and Configure Terraform + # uses: hashicorp/setup-terraform@v1.3.2 + # with: + # terraform_version: 0.14.6 + # terraform_wrapper: false + # - name: Terraform apply - preproduction + # run: | + # echo "Terraform apply - ${TF_ENV}" + # bash scripts/terraform-init.sh terraform/environments/sprinkler + # terraform -chdir="terraform/environments/sprinkler" workspace select "sprinkler-${TF_ENV}" + # bash scripts/terraform-apply.sh terraform/environments/sprinkler + # env: + # TF_ENV: preproduction + + plan-production: + name: Plan Production - sprinkler + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + steps: + - name: Checkout Repository + uses: actions/checkout@v2.3.4 + - name: Load and Configure Terraform + uses: hashicorp/setup-terraform@v1.3.2 + with: + terraform_version: 0.14.6 + terraform_wrapper: false + - name: Terraform plan - production + run: | + echo "Terraform plan - ${TF_ENV}" + bash scripts/terraform-init.sh terraform/environments/sprinkler + terraform -chdir="terraform/environments/sprinkler" workspace select "sprinkler-${TF_ENV}" + bash scripts/terraform-plan.sh terraform/environments/sprinkler + env: + TF_ENV: production + + deploy-production: + name: Deploy Production - sprinkler + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + environment: + name: sprinkler-production + steps: + - name: Checkout Repository + uses: actions/checkout@v2.3.4 + - name: Load and Configure Terraform + uses: hashicorp/setup-terraform@v1.3.2 + with: + terraform_version: 0.14.6 + terraform_wrapper: false + - name: Terraform apply - production + run: | + echo "Terraform apply - ${TF_ENV}" + bash scripts/terraform-init.sh terraform/environments/sprinkler + terraform -chdir="terraform/environments/sprinkler" workspace select "sprinkler-${TF_ENV}" + bash scripts/terraform-apply.sh terraform/environments/sprinkler + env: + TF_ENV: production