forked from appuio/openshift-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathset-template-proxy.sh
More file actions
executable file
·16 lines (13 loc) · 1.12 KB
/
set-template-proxy.sh
File metadata and controls
executable file
·16 lines (13 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
HTTP_PROXY=$http_proxy
HTTPS_PROXY=$https_proxy
NO_PROXY=$no_proxy
json_env="[{\"name\": \"http_proxy\", \"value\": \"${HTTP_PROXY}\" }, {\"name\": \"https_proxy\", \"value\": \"${HTTPS_PROXY}\"}, {\"name\": \"no_proxy\", \"value\": \"${NO_PROXY}\"}]"
jq "(. | select(.kind == \"BuildConfig\").spec.source.git.httpProxy)=\"${HTTP_PROXY}\"" | \
jq "(. | select(.kind == \"BuildConfig\").spec.source.git.httpsProxy)=\"${HTTPS_PROXY}\"" | \
jq "(. | select(.kind == \"BuildConfig\").spec.strategy.customStrategy.env)=${json_env}"
#jq "(.objects[] | select(.kind == \"BuildConfig\").spec.source.git.httpProxy)=\"${HTTP_PROXY}\"" | \
#jq "(.objects[] | select(.kind == \"BuildConfig\").spec.source.git.httpsProxy)=\"${HTTPS_PROXY}\"" | \
#jq "(.objects[] | select(.kind == \"BuildConfig\").spec.strategy.sourceStrategy.env)=${json_env}" | \
#jq "del(.objects[] | select(.kind == \"DeploymentConfig\").spec.template.spec.containers[0].env[] | select(.name == \"http_proxy\" or .name == \"https_proxy\" or .name == \"no_proxy\"))" | \
#jq "(.objects[] | select(.kind == \"DeploymentConfig\").spec.template.spec.containers[0].env)+=${json_env}"