How do I set environment variables to agent (like /etc/default/go-agent) #74
Comments
I'd probably try adding scripts in docker-gocd-agent/docker-entrypoint.sh.erb Lines 113 to 124 in 2b25324
|
Oh maybe I've interpreted it wrong... I thought I want my scripts to be run as the I thought this line made it run docker-gocd-agent/docker-entrypoint.sh.erb Line 126 in 2b25324
...but maybe it's running itself again and thus loading |
This is what led me to configure the
|
@ketan Looking at the logs of my container, I see this happening during startup: /docker-entrypoint.sh: Creating directories and symlinks to hold GoCD configuration, data, and logs
[...]
$ chown go:go /go/config/autoregister.properties
/docker-entrypoint.sh: Running custom scripts in /docker-entrypoint.d/ ...
$ exec /usr/local/sbin/tini -- /usr/local/sbin/gosu go /docker-entrypoint.sh /go-agent/agent.sh
/docker-entrypoint.sh: line 57: /usr/local/bin/nohup.out: Permission denied
$ exec /go-agent/agent.sh
[Thu Sep 06 11:18:35 GMT 2018] Starting process:
[...] ...thus it doesn't seem like it runs those files in Any suggestions of what I could try? |
Here's how things have been designed:
|
What I'd like to do:
Run scripts that set environment variables, which become available to my agents.
Steps I've done:
gocd/gocd-agent-docker-dind
specifically)./etc/profile.d/
, for example this one:/etc/default/go-agent
file, and have it load/etc/profile
:$ cat /etc/default/go-agent . /etc/profile
/etc/profile
in turn should load the files in/etc/profile.d
:...however when I run jobs using this image, my scripts haven't been run, and the environment variables aren't set.
Questions:
/etc/default/go-agent
)service_mode
? I suppose I am (?) — and then my guess (judging from/go-agent/agent.sh
) is that maybe my file won't be loaded:The text was updated successfully, but these errors were encountered: