|
@@ -59,25 +59,24 @@ pipeline {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-*/ stage("Update docker secret in SWARM cluster") {
|
|
|
+*//* stage("Update docker secret in SWARM cluster") {
|
|
|
steps {
|
|
|
script {
|
|
|
-// ENDDATE = sh (script: "echo|openssl s_client -servername ${REGISTRY_OFFICE} -connect ${REGISTRY_OFFICE}:443 2>/dev/null|openssl x509 -noout -enddate", returnStdout: true).trim()
|
|
|
-// if (ENDDATE != NEW_ENDDATE) {
|
|
|
- sh "ls -al"
|
|
|
+ ENDDATE = sh (script: "echo|openssl s_client -servername ${REGISTRY_OFFICE} -connect ${REGISTRY_OFFICE}:443 2>/dev/null|openssl x509 -noout -enddate", returnStdout: true).trim()
|
|
|
+ if (ENDDATE != NEW_ENDDATE) {
|
|
|
git_clone(PKI_GIT_URL)
|
|
|
git_clone(SWARM_GIT_URL)
|
|
|
- sh "ls -al"
|
|
|
echo "Update docker secret in ${CLUSTER_OFFICE}"
|
|
|
NODE_IP = sh (script: "DOCKER_HOST=tcp://${CLUSTER_OFFICE}:2376 DOCKER_TLS_VERIFY=1 docker node inspect self -f '{{.Status.Addr}}'" , returnStdout: true).trim()
|
|
|
update_secret(NODE_IP, SWARM_GIT_NAME, DOMAIN, CONFIG_DIR)
|
|
|
-// }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-/* stage("Update certificate and key") {
|
|
|
+*/ stage("Update certificate and key") {
|
|
|
steps {
|
|
|
script {
|
|
|
+// Следующие 2 строчки после тестирования необходимо убрать, так как репозитории клонируются в предыдущем шаге
|
|
|
git_clone(PKI_GIT_URL)
|
|
|
git_clone(SWARM_GIT_URL)
|
|
|
NEW_ENDDATE = sh (script: "openssl x509 -enddate -noout -in ${CONFIG_DIR}/live/${DOMAIN}/cert.pem", returnStdout: true).trim()
|
|
@@ -85,22 +84,22 @@ pipeline {
|
|
|
ENDDATE = sh (script: "echo|openssl s_client -servername ${item}.${DOMAIN} -connect ${item}.${DOMAIN} 2>/dev/null|openssl x509 -noout -enddate", returnStdout: true).trim()
|
|
|
if (ENDDATE != NEW_ENDDATE) {
|
|
|
echo "Update certificate and key for ${item}"
|
|
|
- def PLAYBOOK = PKI_GIT_NAME + '/' + DOMAIN + '/wildcard/acme-dns/' + apache + '.yml'
|
|
|
+ def PLAYBOOK = PKI_GIT_NAME + '/' + DOMAIN + '/wildcard/acme-dns/' + 'apache.yml'
|
|
|
def TARGET_HOST = item + '.' + DOMAIN
|
|
|
update_sertificate(PLAYBOOK, CONFIG_DIR, TARGET_HOST)
|
|
|
}
|
|
|
}
|
|
|
- ENDDATE = sh (script: "echo|openssl s_client -servername ${SMTP_SERVER} -connect ${SMTP_SERVER} 2>/dev/null|openssl x509 -noout -enddate", returnStdout: true).trim()
|
|
|
+/* ENDDATE = sh (script: "echo|openssl s_client -servername ${SMTP_SERVER} -connect ${SMTP_SERVER} 2>/dev/null|openssl x509 -noout -enddate", returnStdout: true).trim()
|
|
|
if (ENDDATE != NEW_ENDDATE) {
|
|
|
echo "Update certificate and key for ${SMTP_SERVER}"
|
|
|
sh "cat ${PKI_GIT_NAME}/${DOMAIN}/acme-dns/letsencrypt.ca.pem >> ${CONFIG_DIR}/live/${DOMAIN}/fullchain.pem"
|
|
|
- def PLAYBOOK = PKI_GIT_NAME + '/' + DOMAIN + '/wildcard/acme-dns/' + mail + '.yml'
|
|
|
+ def PLAYBOOK = PKI_GIT_NAME + '/' + DOMAIN + '/wildcard/acme-dns/' + 'mail.yml'
|
|
|
update_sertificate(PLAYBOOK, CONFIG_DIR, SMTP_SERVER)
|
|
|
}
|
|
|
- }
|
|
|
+*/ }
|
|
|
}
|
|
|
}
|
|
|
-*/ }
|
|
|
+ }
|
|
|
post {
|
|
|
always {
|
|
|
echo "CleaningUp work directory"
|