Update 'nordvpn-autoconfigure.jenkins'

This commit is contained in:
2021-08-21 13:12:02 +00:00
parent f080b18217
commit 6c86fd035d

View File

@ -28,8 +28,8 @@ def nordURLs = [
] ]
def nordURL = nordURLs[Math.abs(new Random().nextInt() % [8])] def nordURL = nordURLs[Math.abs(new Random().nextInt() % [8])]
def namespace = "dl-automation" def kubeNamespace = "dl-automation"
def secretName = "openvpn" def kubeSecret = "openvpn"
podTemplate( podTemplate(
label: label, label: label,
@ -101,15 +101,15 @@ spec:
"apiVersion: v1" \ "apiVersion: v1" \
"kind: Secret" \ "kind: Secret" \
"metadata:" \ "metadata:" \
" name: ${secretName}" \ " name: \${kubeSecret}" \
" namespace: \${namespace}" \ " namespace: \${kubeNamespace}" \
"data:" \ "data:" \
" openvpn-credentials.txt: \${NORD_CREDS}" \ " openvpn-credentials.txt: \${NORD_CREDS}" \
" us5766.nordvpn.com.tcp.ovpn: \${OPENVPN_CONFIG}" > /tmp/openvpn-secret.kubectl " us5766.nordvpn.com.tcp.ovpn: \${OPENVPN_CONFIG}" > /tmp/openvpn-secret.kubectl
kubectl apply --namespace \${namespace} -f /tmp/openvpn-secret.kubectl kubectl apply --namespace \${kubeNamespace} -f /tmp/openvpn-secret.kubectl
for i in \$(kubectl get pods --namespace \${namespace} --selector app="deluge" -o name); do for i in \$(kubectl get pods --namespace \${kubeNamespace} --selector app="deluge" -o name); do
kubectl delete --namespace \${namespace} \${i} kubectl delete --namespace \${kubeNamespace} \${i}
done done
""" """
} }