GitOps Terraform Automation with Atlantis and Gitea
Advanced · 60 minutes · 100 points
In this advanced lab you will wire together a local Gitea git server and an Atlantis pull-request automation server, both running as Docker containers on a shared network. You will create a Terraform repository in Gitea, configure Atlantis webhooks, and prove that opening a pull request automatically triggers 'terraform plan' while posting an 'atlantis apply' comment executes the apply under Atlantis's built-in locking mechanism.
What you’ll learn
- Launch Gitea and Atlantis containers on a shared Docker network and verify connectivity between them
- Bootstrap a Gitea organisation, user, and Terraform repository with a valid atlantis.yaml and a simple Terraform configuration
- Configure an Atlantis webhook on the Gitea repository so that pull-request events are forwarded correctly
- Open a pull request and confirm that Atlantis posts an automatic 'terraform plan' comment on it
- Post an 'atlantis apply' comment and verify the apply completes and the lock is released
How this lab works
- Start the lab: One click starts a container on your computer with a real terminal: nothing to install by hand, nothing to clean up.
- Work through 5 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work runs each task’s checks in your container and says what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Runs: A container on your computer, with a real terminal
- Image: alpine:3.19
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop installed and running
- The lab drives your Docker engine through its socket: it starts two containers (lxops-gitea, lxops-atlantis) on a network named lxops-atlantis-net
- At least 2 GB of free RAM
Topics: terraform, atlantis, gitea, gitops, pull-request-automation, docker, infrastructure-as-code, webhooks, locking, ci-cd
Create a free account to start this lab.