--
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+un...@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.
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 go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CAA1RwH8zGo6mu0ss0jCCyw0D7Hw4JOwEwfcfNu20yqo0aRRdWw%40mail.gmail.com.
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 go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CAD9m7CxMqUNkCqyx5D5P4HMb0ocMVQYx__VDz1AYN%2B5ukovB3w%40mail.gmail.com.
re: using environments rather than resources... environments can't be defined at the pipeline level either though?
or i guess it's more correct to say that using environments is a bit of a side-car feature, in that we use interact w/environments through a different prisim/ui/config (no biggie) but also seems it's mutually exclusive to maximizing overall usage of agents. for us if a given host can execute something (a pipeline, a job) it should. and if it can't, it shouldn't.trying to force a hard divider can be useful for prod/qa staging, but it seems to limit just being able to have pipelines declare their needs.maybe i'm missing what you're saying but i don't think environments are functionally equivalent to resources?
we use template parameters extensively already.eg we even templatize further inside our own jobs by re-using scripts that interact with template parameters on most commonly used templates (eg our most popular template has maybe 10-15 pipelines).however this is more of a job specific thing since it's at the job level.if you're saying we could change every pipeline to read this at a pipeline level is a non trivial change to every job.
that's ok but i guess my overall question tho would be that if a given job decided it couldn't execute the pipeline parameters... it has no way to pass the job to another agent?
in such an example it would just fail the job, no? again maybe i'm not following but this seems to not allow the business/value level to declare minimum needs(environments seem like they are more about maximimal requirements, but i'm no expert)
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CABr%2BOtrG%2B0X3y4B6AWnN7N0K-OSpcKb4KdG-LbS8fCnMOR8Zdw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CABr%2BOto3xJnzTVup0eGk0zDiaocSrt42bBkRcfwdVKwxdit%3Dtw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CAA1RwH8d2amyXbcEhe8hOnbm6BmS-moT9u7Oo%3D4zzU%2BoXfnekQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CABr%2BOtr%3D-R3fKE0devgPVKgNbHGVnsn5E5OwxuP%3DMt1No_RNdg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CABr%2BOtr%3D-R3fKE0devgPVKgNbHGVnsn5E5OwxuP%3DMt1No_RNdg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CAA1RwH8XmX4y11RT2PVXeUxQd8hvK0UBgbcx8ja-MWuOVqpfag%40mail.gmail.com.
chad thanks for your answer.i think the main source of confusion is that I thought parameters could only be referred to in scripts!I didn't know you could refer to them inside of other configuration properties!Is this documented? Regardless that's super useful, there's probably some other things that can be cleaned up knowing that.I tried this on a pipeline w/out any template and it worked as described. Just put the parameter reference in resource- UI accepts as long as parameter exists and works.I still have a question about how this works in examples using templates.If we didn't define the pipeline parameter by default, how would gocd interpret what I'm guessing would be a blank resource?eg we have
- a pipeline template called FAST_OR_SLOW_PIPE
- every pipeline implementing this template defines a parameter called PIPE_RESOURCE_PARAM
What happens if somebody only defines PIPE_RESOURCE_PARAM when the pipeline is FAST?If it's left as empty for ANY-aka-SLOW resources, will gocd intepret this as a blank resource requirement and fail?Or will it ignore blank resources?It's not a big deal to define it anywhere, but I'm curious how it works when it's undefined since we didn't have this use case previously.If anybody knows would appreciate sharing.For the time being I think this is a better solution than environments, which seems a bit more opinionated and perhaps limiting for other solutions.However chad's demonstrate of the a non-traditional use of environments is helpful for thinking about other ways to use them.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CABr%2BOtoymQdOg0poCtRYDRfxgX4UKfukvtvvpCOZicadaPKWyA%40mail.gmail.com.
chad thanks for your answer.i think the main source of confusion is that I thought parameters could only be referred to in scripts!I didn't know you could refer to them inside of other configuration properties!Is this documented? Regardless that's super useful, there's probably some other things that can be cleaned up knowing that.
I tried this on a pipeline w/out any template and it worked as described. Just put the parameter reference in resource- UI accepts as long as parameter exists and works.I still have a question about how this works in examples using templates.If we didn't define the pipeline parameter by default, how would gocd interpret what I'm guessing would be a blank resource?eg we have
- a pipeline template called FAST_OR_SLOW_PIPE
- every pipeline implementing this template defines a parameter called PIPE_RESOURCE_PARAM
What happens if somebody only defines PIPE_RESOURCE_PARAM when the pipeline is FAST?If it's left as empty for ANY-aka-SLOW resources, will gocd intepret this as a blank resource requirement and fail?Or will it ignore blank resources?
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CABr%2BOtoymQdOg0poCtRYDRfxgX4UKfukvtvvpCOZicadaPKWyA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/43cb7edd-5e0d-4b06-9dac-024e40509d43n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CABr%2BOtp%3DquwcOTJv4jh8xKXf6JpOv5vHADqNkAwqaCS2yEZ%2BtA%40mail.gmail.com.
On Mon, Jul 24, 2023 at 8:44 PM Joshua Franta <jos...@pracplay.com> wrote:chad thanks for your answer.i think the main source of confusion is that I thought parameters could only be referred to in scripts!I didn't know you could refer to them inside of other configuration properties!Is this documented? Regardless that's super useful, there's probably some other things that can be cleaned up knowing that.
If it's left as empty for ANY-aka-SLOW resources, will gocd intepret this as a blank resource requirement and fail?Or will it ignore blank resources?I'm not sure - perhaps just try it empirically? It could either fail or see it as blank i.e "no resource requirement" - I don't think there's a strong case for either behaviour being more correct.-Chad
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CAA1RwH9z%2Bkpdant8aRrDujZ-nag-mb6m_res0KLrPtYoef7Pqw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CABr%2BOtrvLfrhZzs%3DXTDKMFOEQLEiEbxcVtvUk3Lq%3DApFod-XQg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CAA1RwH_u8_45Qyeg%3DESmNUFbdHh-aWv%2BdznV5LZ%3D1JwTOLwG%3Dg%40mail.gmail.com.
Hi all,
I think my confusion comes from the word “script”.
Unless I am missing something, in vanilla GoCD a “script” is an external thing invoked by GoCD, not something embedded in GoCD. Since GoCD is responsible for the substitution of GoCD Parameters, they cannot be used inside an external script that is invoked by GoCD.
I can’t, for example, create a script called “/go/myscript.sh” with “echo #{Param}” as content and then have GoCD execute it with an EXEC Task that calls /go/myscript.sh. Regardless of the value of the Pipeline’s Parameter, this script would simply output “#{Param}”.
Similarly, the default EXEC Task does not parse environment variables. So while “echo #{Param}” works as expected, we can’t create an EXEC Task with “echo $EnvVar”. This outputs the literal string “$EnvVar”.
I suspect, therefore, that Josh is using a plugin (probably this one) that allows one to embed a script into GoCD so that parameters are expanded by GoCD before the script code is passed to the agent and the agent’s runtime environment is responsible for expanding environment variables referenced in the script. This is not a use case I have been exposed to before, but it would explain the gap between Josh’s understanding and my own.
I agree with Josh, though, that this is off-topic for the thread.
Back on-topic, I’m glad to hear that Josh got what he needed. As for the interaction between Parameters and Resources, I’m pretty sure I covered it in my earlier post so I won’t repeat myself here.
Cheers,
Jason
-Chad
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CABr%2BOtrhsksVXzMd-cE%3DsRb2FsTB7ryn%2BBOF76SEWs9xcpn58Q%40mail.gmail.com.