Have you tried to use "environments" (or a mix of environments and
resources) to achieve what you are trying to?

When scheduling jobs it's the combination of the resource and the
environment that are matched to an agent, but the relevant environment is
declared at the pipeline level like you refer to. Don't need to get hung up
on the name so much. Yes, you can have "environment variables" attached to
an environment and propagate those to all pipelines within it, but you
don't have to use them like that.

Alternatively, to make the templates less duplicated and allow the resource
to flow from the pipeline *using* the template, you could try using template
parameters
<https://docs.gocd.org/current/configuration/admin_use_parameters_in_configuration.html>
in the resources field? e.g #{job-resoure-requirement}? If there are only a
small number of different resources used across the stages/jobs, you could
use the parameters to "model" this I imagine.

-Chad

On Sat, Jul 22, 2023 at 6:54 PM Josh <jos...@pracplay.com> wrote:

> QUESTION:
>
> Shouldn't we also be able to communicate a resource requirement at the
> pipeline level, and not just inside a single job?
>
> I get that it definately needs to be at the job level since that's the
> smallest unit of work and some machines can't execute certain tasks.
> But at the value-stream/pipeline/business level, you also want to be able
> to have some pipelines compiling on preferred resources, no?
>
>
> is there a better way to accomplish this?
> or perhaps this already is possible and i'm missing it.
> i looked closely at the config since sometimes you can do something simple
> that is not possible inside the UI, but I'm not seeing it.
>
> To restate use case:  We have some pipelines that are given higher
> preferences for agent/build resources.   Wanting to do a lot more of this,
> but it's tricky because resources can only be defined at the job level (in
> the UI).     Also we use a lot of templates, so having resources at job
> level means we end up having lots of alsomost identical templates that only
> vary by the resources used (which somewhat defeats the point of the
> templates and the value of gocd in this respect).
>
> hoping there is a config hack or maybe i'm missinig something.
> also if this could be done in a plugin, any color there would be helpful
> (and i would make sure it's open sourced if need be).
>
> thx
>
> ps i keep using other ci/cd products and gocd is still one of the all
> around bests.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "go-cd" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to go-cd+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/go-cd/a9a4ba2c-b1c9-4202-9408-3e2566929b59n%40googlegroups.com
> <https://groups.google.com/d/msgid/go-cd/a9a4ba2c-b1c9-4202-9408-3e2566929b59n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to go-cd+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/go-cd/CAA1RwH8zGo6mu0ss0jCCyw0D7Hw4JOwEwfcfNu20yqo0aRRdWw%40mail.gmail.com.

Reply via email to