escapes variables for jenkins.
This commit is contained in:
parent
35ac0be1b5
commit
a229c3e292
@ -46,46 +46,45 @@ spec:
|
|||||||
container('kaniko') {
|
container('kaniko') {
|
||||||
def connectivity_test = """
|
def connectivity_test = """
|
||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
if [[ -z "${DDNS_HOST}" ]] || [[ "${DDNS_HOST}" == "" ]]; then
|
if [[ -z "\${DDNS_HOST}" ]] || [[ "\${DDNS_HOST}" == "" ]]; then
|
||||||
printf '%s\n' "Dynamic DNS host is not set."
|
printf '%s\n' "Dynamic DNS host is not set."
|
||||||
exit 100
|
exit 100
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf '%s\n' "Detecting public IP"
|
printf '%s\n' "Detecting public IP"
|
||||||
DIP=$(dig @ns1.google.com TXT o-o.myaddr.l.google.com +short | sed -e 's/"//g')
|
DIP=$(dig @ns1.google.com TXT o-o.myaddr.l.google.com +short | sed -e 's/"//g')
|
||||||
if [[ -z "${DIP+x}" ]] || [[ "${DIP}" == "" ]]; then
|
if [[ -z "\${DIP+x}" ]] || [[ "\${DIP}" == "" ]]; then
|
||||||
printf '%s\n' "Unable to detect real-world IP."
|
printf '%s\n' "Unable to detect real-world IP."
|
||||||
exit 100
|
exit 100
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf '%s\n' "Getting known IP"
|
printf '%s\n' "Getting known IP"
|
||||||
KIP=$(dig ${DDNS_HOST} +short)
|
KIP=$(dig \${DDNS_HOST} +short)
|
||||||
if [[ -z "${KIP+x}" ]] || [[ "${KIP}" == "" ]]; then
|
if [[ -z "\${KIP+x}" ]] || [[ "\${KIP}" == "" ]]; then
|
||||||
printf '%s\n' "Unable to get known IP."
|
printf '%s\n' "Unable to get known IP."
|
||||||
exit 100
|
exit 100
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${DIP}" == "${KIP}" ]]; then
|
if [[ "\${DIP}" == "\${KIP}" ]]; then
|
||||||
printf '%s\n' "VPN is not functional."
|
printf '%s\n' "VPN is not functional."
|
||||||
exit 100
|
exit 100
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf '%s\n' "Checking connectivity (1 of 2)"
|
printf '%s\n' "Checking connectivity (1 of 2)"
|
||||||
ping -c 2 google.com > /dev/null
|
ping -c 2 google.com > /dev/null
|
||||||
if [[ "${?}" != "0" ]]; then
|
if [[ "\${?}" != "0" ]]; then
|
||||||
printf '%s\n' "No internet connectivity."
|
printf '%s\n' "No internet connectivity."
|
||||||
exit 100
|
exit 100
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf '%s\n' "Checking connectivity (2 of 2)"
|
printf '%s\n' "Checking connectivity (2 of 2)"
|
||||||
curl --silent --fail --insecure https://www.msftncsi.com/ncsi.txt > /dev/null
|
curl --silent --fail --insecure https://www.msftncsi.com/ncsi.txt > /dev/null
|
||||||
if [[ "${?}" != "0" ]]; then
|
if [[ "\${?}" != "0" ]]; then
|
||||||
printf '%s\n' "No internet connectivity."
|
printf '%s\n' "No internet connectivity."
|
||||||
exit 100
|
exit 100
|
||||||
fi
|
fi
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
def dockerfile = """FROM linuxserver/deluge:amd64-latest
|
def dockerfile = """FROM linuxserver/deluge:amd64-latest
|
||||||
COPY connectivity_test.sh /root
|
COPY connectivity_test.sh /root
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user