Replies: 7 comments 2 replies
-
the description is a little bit confusing.
Probably you meant "with targes prod here. Anyway, could you pls also show the command line(s) you used to run it? |
Beta Was this translation helpful? Give feedback.
-
Yes, i mean with prod, sorry: |
Beta Was this translation helpful? Give feedback.
-
Basicly the stage target copies stuff to the server, the prod build however should only build some stuff and then upload the binary to a artifactory (this is not in the script). Anyway the "manage server" should not be evaluated for target prod |
Beta Was this translation helpful? Give feedback.
-
I have not tried to replicate it, but from a quick view, your playbook seems to have a few issues:
Generally, the root cause of this confusion is a mix-up between targets and tasks. For what you are trying to achieve, you just need to run different tasks. This can be either separate playbook files for production and staging or alternatively running the same playbook with only/skip flags. |
Beta Was this translation helpful? Give feedback.
-
Yes you are right i am missusing the targets :) and of course i can use different playbooks for prod and stage or work with only/skip flags, but i though having everything in one spot-file and just distinguishing by the target would also work nice. It is working for setting the variables e.g. But anyway would it be bad, if tasks / commands would not be executed, it the target does not match? I mean that would open a whole new way of creating the scripts? |
Beta Was this translation helpful? Give feedback.
-
or alternativly having a target selector like "only_for_task": []string that one could use to include/exclude tasks/commands for targets? |
Beta Was this translation helpful? Give feedback.
-
moving to discussion as I don't see a bug here |
Beta Was this translation helpful? Give feedback.
-
I'm running into a problem with the evaluation of a target. Following script
So pretty basic one. 2 targets stage and prod. But somehow the last tast "manage server" is also called for prod target:
Am i doing something wrong here? With targets: ["stage"] "manage server" should not be called at all right?
Beta Was this translation helpful? Give feedback.
All reactions