Re: [go-cd] How to get all environment variables of a running task?

2021-01-30 Thread zuk...@gmail.com
Found it, it's stored on the go-server itself not in the go-agent. For googlers in the future, go stores console output to "godata/artifacts/pipelines/" On Saturday, January 30, 2021 at 6:12:27 PM UTC zuk...@gmail.com wrote: > Are the logs from a Go task stored anywhere? I can't seem to find

Re: [go-cd] How to get all environment variables of a running task?

2021-01-30 Thread zuk...@gmail.com
Are the logs from a Go task stored anywhere? I can't seem to find the log. On Saturday, January 30, 2021 at 4:30:12 PM UTC zuk...@gmail.com wrote: > I can write them to a file, but they require knowledge of the default set > env vars i.e. "GO_SERVER_URL", "GO_*" etc.. > > It seems there are a

Re: [go-cd] How to get all environment variables of a running task?

2021-01-30 Thread zuk...@gmail.com
I can write them to a file, but they require knowledge of the default set env vars i.e. "GO_SERVER_URL", "GO_*" etc.. It seems there are a few approaches: 1. `cat` the go-agent log and extract env var key and value using regex against "setting environment variable 'GO_SERVER_URL' to value '

Re: [go-cd] How to get all environment variables of a running task?

2021-01-30 Thread zuk...@gmail.com
I can write them to a file, but they require knowledge of the default set env vars i.e. "GO_SERVER_URL", "GO_*" etc.. It seems there are a few approaches: 1. `cat` the go-agent log and extract env var key and value using regex against "setting environment variable 'GO_SERVER_URL' to value

Re: [go-cd] How to get all environment variables of a running task?

2021-01-30 Thread zuk...@gmail.com
Ah you re-posted. The reason why I don't want to explicitly state what is required is because it means you can set any env var in Go CI/CD (in stage, job etc..) and you won't require changes to the bash script underneath. It's a cleaner approach. On Saturday, January 30, 2021 at 4:22:03 PM UTC

Re: [go-cd] How to get all environment variables of a running task?

2021-01-30 Thread zuk...@gmail.com
I understand they are running in a separate bash shell, let me clarify the question. If I run "env" other environment variables will be printed to stdout. I am only interested in the specific environment variables that are posted above without filtering it. On Saturday, January 30, 2021 at

Re: [go-cd] How to get all environment variables of a running task?

2021-01-30 Thread 'Ashwanth Kumar' via go-cd
Okay, I just realised from this post once again. I don't think there is any way to get only those values that are set directly, instead if you know what those values are then you can write a script to write these values into a text file and use that as a artifact for the remaining Tasks. Having

Re: [go-cd] How to get all environment variables of a running task?

2021-01-30 Thread 'Ashwanth Kumar' via go-cd
The process environment variables overrides the system variables (if any). If you're interested only in the environment variables that are shown above you don't have to worry about value being changed or overwritten by another process because GoCD uses *bash -c* to run tasks with the new variables

Re: [go-cd] How to get all environment variables of a running task?

2021-01-30 Thread zuk...@gmail.com
>From my understanding, "env" prints out all the system environment variables, rather than the process environment variables. If I used "env" and a parallel job was running, wouldn't it overwrite the environment variables (non thread-safe env vars)? On Saturday, January 30, 2021 at 3:48:59 PM

Re: [go-cd] How to get all environment variables of a running task?

2021-01-30 Thread 'Ashwanth Kumar' via go-cd
If you're on a Linux instance try using the *env* command. On Sat, 30 Jan, 2021, 21:14 zuk...@gmail.com, wrote: > Hi all, > > I am deploying an image to AWS ECS using task definitions. In order for me > to inject the environment variables from Go into the task definition, I > require all the

[go-cd] How to get all environment variables of a running task?

2021-01-30 Thread zuk...@gmail.com
Hi all, I am deploying an image to AWS ECS using task definitions. In order for me to inject the environment variables from Go into the task definition, I require all the environment variables that Go sets when a pipeline is running. For instance: [image: envvars.png] I want to get all those