This message was deleted.
# atlantis-community
s
This message was deleted.
r
Thanks @Justin S! 🙏 I will test it now 😮 it sounds a great workaround.
Please what about your "repo-config-generator" ? We use terraform workspaces in our multiples stacks. Did you use this pre workflow to be able to not write atlantis.yaml on each repo ?
j
the script actually does nothing
was there to test parallel plans, but since we dont use workspaces.. it breaks
Copy code
❯ cat repo-config-generator.sh 
#!/usr/bin/env bash
shopt -s globstar
set -euo pipefail
echo '{"version":3,"parallel_plan":false,"parallel_apply":false,"projects":}' | yq -PM > atlantis.yaml
grep -P 'backend[\s]+"s3"' **/*.tf |
  rev | cut -d'/' -f2- | rev |
  sort |
  uniq |
  while read -r d; do \
    echo '[ {"name": "'"$d"'","dir": "'"$d"'", "autoplan": {"when_modified": ["*.tf", "**/*.tpl","**/*.yaml.tpl", ".terraform.lock.hcl"] }} ]' | yq -PM >> atlantis.yaml; \
  done
Its 100% not a requirement for anything.. it essentially does nothing in this context
The only other thing we do, is turn off the normal Merge Request Approver stuff in Gitlab
and then on branch protection, enabled the CODEOWNER approver stuff
then use a CODEOWNER file to say who needs to approve what
r
Ok thanks for the script. It can help me to start mine 🙌 Noticed for the gitlab stuffs, needs to do a deep dive on it asap
j
Copy code
❯ cat CODEOWNERS 
[operations] @operationsapprovers
.tfgen.yaml
dev/us-west-2/ops/

[prod][2] @prodapprovers
prod/

[staging] @TREx
dev/us-west-2/deploys/staging/
so on this account, anything under
/dev
that ISNT under
ops
doesnt need an approval, so anyone can create MR plan/apply
Where, in our other account its like this
Copy code
❯ cat CODEOWNERS 
[trex] @trex
*

[operations] @justin @sebastien
dev/ops/
external/
remote_access/
NOTES.md

[justin] @justin
dev/deploys/jls/
basically. someone has to approve everything, even if you are approving yourself
unless its in certain folders, which have actual rules in place
our dev's hated having to get approval, for making a change in their own dev space for instance.
😅 1
r
Thanks for everything 👏 I will test all of this. Have a great day @Justin S
r
@Justin S how did you upload the ./repo-config-generator.sh script to atlantis?
j
its in the repo being cloned
so, all of my repo's handled by this atlantis, have that script sitting in the root