Hi everyone! I'm trying to split a workflow so tha...
# atlantis-community
d
Hi everyone! I'm trying to split a workflow so that different changes in different paths, trigger an apply in a single path, but with a different
extra_args
applying a different vars-file. I created 2 different workflows with different
extra_args
and in atlantis.yaml I use those with the same
dir
but a different path in
when_modified
This causes an apply error:
Copy code
Apply Error

building command for dir "path/to/dir": must specify project name: more than one project defined in atlantis.yaml matched dir: "path/to/dir" workspace: "default"
I cannot disable
parallel_apply
for the entire repo, so I tried instead to place the two workflows under different numbered
execution_order_group
but that didn't solve the issue
I just tried to disable
parallel_apply
and it also didn't work
p
can you share the atlantis.yaml and the atlantis version?
d
These are the two workflows:
Copy code
deploy-wf1:
      plan:
        steps:
          - multienv: multienv /secrets/dev.env
          - init
          - plan:
              extra_args: ["-var-file", "wf1.tfvars"]
      apply:
        steps:
          - multienv: multienv /secrets/dev.env
          - apply:
              extra_args: ["-var-file", "wf1.tfvars"]

  deploy-wf2:
      plan:
        steps:
          - multienv: multienv /secrets/dev.env
          - init
          - plan:
              extra_args: ["-var-file", "wf2.tfvars"]
      apply:
        steps:
          - multienv: multienv /secrets/dev.env
          - apply:
              extra_args: ["-var-file", "wf2.tfvars"]
And then in the repo, I have the following in atlantis.yaml:
Copy code
---
version: 3

parallel_plan: true
parallel_apply: true

abort_on_execution_order_fail: true

projects:
- workflow: deploy
  dir: mydir
  execution_order_group: 1
  autoplan:
    when_modified:
      - "*.tf*"
      - "../subdir1/*/*.yml"
      - "!../subdir1/subdir11/*.yml"
      - "!../subdir1/subdir22/*.yml"

- name: wf1  
  execution_order_group: 2
  workflow: deploy-wf1
  dir: mydir
  autoplan:
    when_modified:
      - "../subdir1/subdir11/*.yml"

- name: wf2
  execution_order_group: 3
  workflow: deploy-wf2
  dir: mydir
  autoplan:
    when_modified:
      - "../subdir1/subdir22/*.yml"
p
mmm I don't know if the execution order group could be doing something here, I will suggest enabling debug and see the execution steps in the logs
d
I'm basically trying to run a wf in the same dir, and pass a different set of tfvars depending on in which subdir a change occured
maybe there's a better way?