Taking another stab after Chad at answering the following question,
> 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).
Since you are asking resource to be at a pipeline level, you can assign the
resource for every job within a template to be #{pipline_resource} (a
pipeline parameter) and set the value of pipeline_resource parameter at a
pipeline level so all the jobs now have the same resource and the value is
now essentially controlled at a pipeline level. This way you don't need
duplicate templates varying by job resources anymore. This is what Chad
meant when he said "You said you had many templates that varied only by the
"resources" field for jobs. If that is the stated problem then parameters
are a possible solution to remove duplication, no?"
Thanks,
On Sat, 22 Jul 2023 at 17:52, Joshua Franta <[email protected]> wrote:
>
> thanks ashwanth- we already use parameter a ton.
>
> i don't understand how a job could look at a parameter and force the job
> to a more capable agent.
> i can definitely have a job fail based on a pipeline level parameter, but
> obviously trying to keep everything green here.
>
> if you're sure it's possible, can you provide a bit more of an example?
>
> On Sat, Jul 22, 2023 at 7:08 AM 'Ashwanth Kumar' via go-cd <
> [email protected]> wrote:
>
>> Use Parameters.
>>
>> On Sat, Jul 22, 2023, 16:24 Josh <[email protected]> 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 [email protected].
>>> 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 a topic in the
>> Google Groups "go-cd" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/go-cd/_j5JGmoA2kI/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/go-cd/CAD9m7CxMqUNkCqyx5D5P4HMb0ocMVQYx__VDz1AYN%2B5ukovB3w%40mail.gmail.com
>> <https://groups.google.com/d/msgid/go-cd/CAD9m7CxMqUNkCqyx5D5P4HMb0ocMVQYx__VDz1AYN%2B5ukovB3w%40mail.gmail.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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/go-cd/CABr%2BOto3xJnzTVup0eGk0zDiaocSrt42bBkRcfwdVKwxdit%3Dtw%40mail.gmail.com
> <https://groups.google.com/d/msgid/go-cd/CABr%2BOto3xJnzTVup0eGk0zDiaocSrt42bBkRcfwdVKwxdit%3Dtw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
--
Ashwanth Kumar / ashwanthkumar.in
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/go-cd/CAD9m7CwB%3DNcMX4ye%2Bnt1F%2Bn-PWqHowdV-ABvZ7K%2BELHx1PUGsg%40mail.gmail.com.