Hello community! Is anyone using Terramate with At...
# atlantis-community
o
Hello community! Is anyone using Terramate with Atlantis?
r
I tested it out and it is possible. I never wrote up docs for it. If someone has it setup, it would be great to add that to the docs 😁
I believe terramate also has native support for gha so atlantis would be helpful for non github setups (bitbucket, gitlab, etc)
o
Can you briefly describe how did you use? My understanding is that I might be able to use terramate solely for code generation. Once such code is committed and pushed it's picked up by Atlantis anyway. Wonder in what scenarios do you use any other terramate's features?
r
I believe i had to play with the atlantis.yaml to detect changes in files terramate understands, then allow terramate to do the code generation and run the plan/apply workflows
o
So you didn't commit the generated files to the repo?
r
Nope
I don't think that would be best practice
But you certainly could do it if necessary
o
@RB do you happen to have any useful examples how you executed terramate generate in pre workflow hooks?
r
I dont im sorry. Have you had issues with pre workflow hooks and terramate ?
o
I was hoping for some best practises / inspiration, just don't want to reinvent the wheel.
Thanks for the article, looks interesting and it has some weird magic voodoo that I'm exactly talking about.
r
magic voodoo is probably how every integration is built with atlantis lol
its usually a preworkflow that does something
and i see this in the article.
Copy code
- pre_workflow_hooks:
        # to run 'safeguards' terramate wants origin master 
        #   and some previous commits
        - run: |
            git config --add remote.origin.fetch +refs/heads/master:refs/remotes/origin/master
            git fetch --depth=1 origin master
            git fetch --depth=2
          description: Fetch origin master branch

        # this step is optional
        # I use .tm-run-order later to made Atlantis 
        #   to run plan/apply in a specified order
        # Also, I generate an atlantis.yaml config 
        #   with terramate too, so I exclude it from run order: 
        #   it's just a yaml, not tf-code
        - run: terramate list --run-order -c --no-tags atlantis -B origin/master > .tm-run-order
          description: Get changed stacks

        # And the obvious final step =)
        - run: terramate generate
          description: Generating tf code
seems like what you might need