Support for configuring a Spacelift Stack to "track" a git tag rather than a branch
We have a use case where we want to deploy some infra into multiple environments from a repository that uses git tags to semantically version the infra. By configuring a Stack to point at a git tag rather than a branch we could align the way we use Spacelift to manage this use case with our existing DevOps process.
Our use case is a little bit different than Spacelift’s typical use case where a branch is tracked for infra changes. In our case, we’re not planning changes to this infrastructure. We just want to be able to create multiple stacks that deploy this infra into different environments.
If (when) we need to make changes to this infrastructure, we will approach this by reconfiguring Stacks to point at a newer git tag.
- Workaround
- Problem
Log in to comment and vote
Comments8
Blue Brownie
Aug 10
I need this ASAP. Some small orgs may be able to use branches alone for continuous delivery but in large organizations who running many identical environments, we don’t deploy to all environments simultaneously - a branch wont work.
I want to be able to specify a tag and continue using it for future deployments (like when a variable needs to change or drift detection) all while the UI/API show that I’m pointed at that specific tag.
Purple Coast
Jan 28
•Merged request
•1 vote
Support git tags for Stack source
Spacelift stacks can point to a specific git repo branch but not a tag.
Requesting support for git tags
Beige Celestial
Jun 3, 2025
Voting for this, we release modules with semantic versioning, but is unable to manage what version we would be deploying from a stack, since its just targeting the main branch currently.
Beige Celestial
Jun 6, 2025
Just wanted to shared, this is supported by Terraform Cloud out-of-box:
Pink Octopus
Apr 15, 2025
Hi @Zeid Derhally
I’m Claudiu from the Product team at Spacelift. I wanted to reach out and check in on how things are going.
I noticed you mentioned finding a solution using a push policy, and even referenced this example—that’s great to hear! I’d really appreciate it if you could share a bit more about your experience so far.Did the push policy fully address it?
Looking forward to your insights!
Best regards,
Claudiu
Gold Pear
May 12, 2025
We did end up adding a push policy to accommodate the repos using tag based tracking, but I think it would be good for Spacelift to support tag based tracking without having to go through the extra work to create a push policy.
Beige Celestial
Jun 6, 2025
As I understand it, a push policy would always deploy the latest released version (and possibly “only” when a new version is released?
For our use-case, we would like the option to specify what version should be deployed by the stack. This should be on the stack level, not policy, as a policy to use release tags would likely be shared.
This is how Terraform Cloud solved this configuration of the stack itself:
Gold Pear
Apr 4, 2025
Can this be done with a push policy similar to modules?
https://docs.spacelift.io/concepts/policy/push-policy#tag-driven-terraform-module-release-flow
Actually an example is provided here:
https://docs.spacelift.io/concepts/policy/push-policy#applying-from-a-tag