allow DEBUG env in entrypoint

This commit is contained in:
Chai Feng 2018-10-03 15:43:44 +08:00
parent be9bdf1782
commit 52ca7eda4d
No known key found for this signature in database
GPG Key ID: 2DCD9A24E523FFD2

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
set -euo pipefail set -euo pipefail
[[ -n "${DEBUG:-}" ]] && set -x
[[ 0 -eq "$#" ]] && set -- start [[ 0 -eq "$#" ]] && set -- start
ufw_docker_agent=ufw-docker-agent ufw_docker_agent=ufw-docker-agent
@ -24,7 +24,6 @@ function ufw-update-service-instances() {
docker ps -qf "label=com.docker.swarm.service.id=${id}" | docker ps -qf "label=com.docker.swarm.service.id=${id}" |
while read name; do while read name; do
echo "$id $name $port"
ufw-update-rule-for-instance "${name}" "$port" ufw-update-rule-for-instance "${name}" "$port"
done done
} }
@ -35,7 +34,6 @@ function update-ufw-rules() {
-e 's/="/ /' \ -e 's/="/ /' \
-e 's/"$//' | -e 's/"$//' |
while read id port; do while read id port; do
echo "${id}=$port"
ufw-update-service-instances "${id}" "${port}" ufw-update-service-instances "${id}" "${port}"
done done
} }