Hello Yuri,

Yes, it's a fair question. I see it as just a way of isolating agents and 
pipelines as mentioned here: 
https://docs.gocd.org/current/introduction/concepts_in_go.html#environment. 
There are subtle differences between using environments and just using 
resources, but they can be mitigated by using resources properly. For instance:

1. If you add a new job to the "deploy to production" pipeline and forget to 
set the right resources, then any agent (even the "building agent" in your 
example) can pick up that job.

2. Resources need to be managed at the job level, whereas an environment works 
at a higher level, essentially being a default "resource" at the pipeline level.

However, with careful use of resources, you should be able to easily reproduce 
similar effects, without using environments, as you said.

Cheers,
Aravind

On Fri, Mar 06, 2020 at 04:08:59 -0800, Yuri Lukyanov wrote:
> Hello!
> 
> I've been using GoCD for quite a while but still didn't get the concept of 
> Environments in full.
> 
> I can't think of a real use case that would be beneficial using 
> environments.
> 
> The first thing that comes to my mind when I hear "environments" is the 
> words "production" and "staging".
> Are the environments in GoCD of the same level?
> 
> Let's say I have the "build" pipeline (1), the "deploy to staging" pipeline 
> (2) and the "deploy to production" pipeline (3).
> And there are two agents
> (a) building agent
> (b) a control node for deployments (for both, production and staging)
> 
> I can just assign resources to the agents.
> 
> Why would I need environments? I'm not telling they are not needed, I'm 
> just trying to understand potential use cases.
> 
> One small benefit I see when grouping pipelines by environments is having 
> the ability to specify a different set of environment variables,
> say for (2) and (3). But those are different pipelines anyway, I can just 
> use slightly different commands in them, just like parameters in tasks.
> 
> Maybe I'm completely missing something here. Could you share some of your 
> use cases?

-- 
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/20200309081843.ynrk2jxw6n326rqx%40arvindsv.com.

Reply via email to