Created
November 21, 2022 15:01
-
-
Save billmetangmo/05f39ddde47138dc41b87a45c7a5db20 to your computer and use it in GitHub Desktop.
sample atlantis
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
| repos: | |
| - id: $REPO | |
| delete_source_branch_on_merge: true | |
| workflow: datadog | |
| apply_requirements: | |
| - approved | |
| - undiverged | |
| pre_workflow_hooks: | |
| - run: | | |
| /usr/local/bin/rebase $REPO/c/-/merge_requests/$PULL_NUM | |
| cd $DIR | |
| echo 'version: 3' > atlantis.yaml | |
| echo 'projects:' >> atlantis.yaml | |
| projects=$(find datadog ! -name messages ! -name modules ! -name doc -not -path '*/\.*' -maxdepth 2 -type d -exec echo {} \;) | |
| for project in $projects; do | |
| echo '- dir:' $project >> atlantis.yaml | |
| done | |
| projects=$(find aws ! -name messages ! -name modules ! -name doc -not -path '*/\.*' -maxdepth 2 -type d -exec echo {} \;) | |
| for project in $projects; do | |
| echo '- dir:' $project >> atlantis.yaml | |
| done | |
| workflows: | |
| default: | |
| plan: | |
| steps: | |
| - run: /var/lib/atlantis/bin/terraform$ATLANTIS_TERRAFORM_VERSION fmt -check=true -diff=true -write=false -recursive | |
| - init | |
| - plan | |
| datadog: | |
| plan: | |
| steps: | |
| - run: /usr/local/bin/rebase $REPO/-/merge_requests/$PULL_NUM | |
| - run: | | |
| for name in global backend main provider; do | |
| if [ ! -f ./${name}.tf ]; then | |
| if [ -f ../${name}.tf ]; then | |
| ln -s ../${name}.tf; | |
| else | |
| ln -s ../../${name}.tf; | |
| fi; | |
| fi; | |
| done | |
| - run: rm -rf .terraform | |
| - run: /var/lib/atlantis/bin/terraform$ATLANTIS_TERRAFORM_VERSION fmt -check=true -diff=true -write=false -recursive | |
| - run: /var/lib/atlantis/bin/terraform$ATLANTIS_TERRAFORM_VERSION init -input=false -no-color -backend-config=key=${REPO_REL_DIR}.tfstate > /dev/null | |
| - plan |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment