atlantis icon indicating copy to clipboard operation
atlantis copied to clipboard

[Feature request] Allow planning multiple dirs at once

Open richstokes opened this issue 4 years ago • 1 comments

It would be really helpful if you could do e.g.

atlantis plan -d terraform/prod -d terraform/staging to plan multiple directories at the same time.

This assumes the scenario in which each dir has its own backend/state, so theres no reason why both couldn't be planned in parallel.

Thanks!

richstokes avatar Dec 07 '20 20:12 richstokes

Related: https://github.com/runatlantis/atlantis/issues/1288#issuecomment-739297461

mwarkentin avatar Dec 07 '20 21:12 mwarkentin

FWIW I've been able to make this work with multiple comments. Each comment calls out a different directory with it's own state/backend. You just have to make sure that you don't create the comments too soon after the previous comment, I wait about 3-5 seconds between comments. This will result in multiple plans being generated at the same time. It's a little tedious and causes comment spam for anyone following the PR but it works.

corradomatt avatar Nov 30 '22 17:11 corradomatt

you can do this at the project level. if you have a project per dir ( autogenerated atlantis.yaml) you can plan using regex.

https://www.runatlantis.io/docs/server-configuration.html#enable-regexp-cmd

On Wed, Nov 30, 2022 at 9:49 AM corradomatt @.***> wrote:

FWIW I've been able to make this work with multiple comments. Each comment calls out a different directory with it's own state/backend. You just have to make sure that you don't create the comments too soon after the previous comment, I wait about 3-5 seconds between comments. This will result in multiple plans being generated at the same time. It's a little tedious and causes comment spam for anyone following the PR but it works.

— Reply to this email directly, view it on GitHub https://github.com/runatlantis/atlantis/issues/1299#issuecomment-1332528205, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ3ERAKDGW64TGJPEKCHBLWK6HQ5ANCNFSM4URAIGIQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jamengual avatar Nov 30 '22 18:11 jamengual

Having this feature will be super helpful!

ShradhaKhard avatar Dec 08 '22 21:12 ShradhaKhard

@ShradhaKhard you can do this now, set --enable-regexp-cmd on atlantis, and use a regular expression to filter.

atlantis plan -p .*(dev|prod).*

nitrocode avatar Dec 08 '22 22:12 nitrocode

This may be a duplicate of https://github.com/runatlantis/atlantis/issues/686 and https://github.com/runatlantis/atlantis/issues/2757. Closing for now to consolidate discussion in 686

nitrocode avatar Dec 08 '22 22:12 nitrocode

Bumping on this a couple of years later as I don't think it's a duplicate of #686 or #2757

The issue refers to the ability to write a a comment of the form atlantis plan -d stateDir1 -d stateDir2 in github/gitlab/etc that the webhook url recognizes and parses properly into planning multiple directories

I believe this serves a different purpose than the atlantis.yml configuration and it adds some value

laertis avatar Apr 16 '24 11:04 laertis

I agree with @laertis, the directories may not follow a wildcard-compatible naming scheme. either multiple -d arguments, or a version of the argument that can accept a list, e.g. -d [dir_1, dir_2, some_other_dir]

RobertAlbus avatar Jun 06 '24 21:06 RobertAlbus