JetBrains / teamcity-docker-agent

TeamCity agent docker image sources
https://hub.docker.com/r/jetbrains/teamcity-agent/
Apache License 2.0
77 stars 64 forks source link

add additional configuration settings #14

Closed peshay closed 6 years ago

peshay commented 6 years ago

I want to configure with environment variables also the ownAddress and ownPort for the Agent. In order to achieve that, I patched the run-agent.sh

--- run-agent.sh    2018-02-02 13:11:49.000000000 +0100
+++ run-agent.sh    2018-02-02 13:10:44.000000000 +0100
@@ -19,6 +19,8 @@
     [[ -n "${SERVER_URL}" ]]  && opts[${#opts[@]}]='--server-url' && opts[${#opts[@]}]="$SERVER_URL"
     [[ -n "${AGENT_TOKEN}" ]] && opts[${#opts[@]}]='--auth-token' && opts[${#opts[@]}]="$AGENT_TOKEN"
     [[ -n "${AGENT_NAME}" ]]  && opts[${#opts[@]}]='--name'       && opts[${#opts[@]}]="$AGENT_NAME"
+    [[ -n "${OWN_ADDRESS}" ]] && opts[${#opts[@]}]='--ownAddress' && opts[${#opts[@]}]="$OWN_ADDRESS"
+    [[ -n "${OWN_PORT}" ]]  && opts[${#opts[@]}]='--ownPort'       && opts[${#opts[@]}]="$OWN_PORT"
     if [[ 0 -ne "${#opts[@]}" ]]; then
       # Using sed to strip double quotes produced by docker-compose
       for i in $(seq 0 $(expr ${#opts[@]} - 1)); do
VladRassokhin commented 6 years ago

Merged https://github.com/JetBrains/teamcity-docker-minimal-agent/pull/20