Created
January 13, 2020 04:57
-
-
Save KyMidd/abf127de5f4147d8421b372ef6f39378 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Terraform Plan and Apply | |
| # Plan only on pull requests, Apply on merged code | |
| jobs: | |
| include: | |
| - stage: terraform plan | |
| # Only run terraform validate and plan state if within a pull request | |
| if: type IN (pull_request) | |
| script: | |
| - echo "Executing Terraform Plan on pull request code" | |
| - terraform init $tf_init_cli_options | |
| - terraform validate $tf_validation_cli_options | |
| - terraform plan $tf_plan_cli_options | |
| - stage: terraform apply | |
| # Only run terraform apply stage if outside of a pull request | |
| if: type IN (push) and branch = master | |
| script: | |
| - echo "Executing Terraform Apply on merged code" | |
| - terraform init $tf_init_cli_options | |
| - terraform apply $tf_apply_cli_options |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment