Владимир Томишинец 5 years ago
parent
commit
a49fdaed4e
1 changed files with 6 additions and 0 deletions
  1. 6 0
      IRURenewalWildcardJenkinsfile

+ 6 - 0
IRURenewalWildcardJenkinsfile

@@ -9,6 +9,8 @@ pipeline {
     label "swarm"
   }
   environment {
+    REGISTRY_PROD='registry.infoclinica.ru'
+    REGISTRY_DEV='dev-registry.infoclinica.ru'
     CLUSTER_NAME_OPEN='iru-swarm1-open.infoclinica.ru'
     CLUSTER_NAME_PROD='iru-swarm.infoclinica.lan'
     CLUSTER_NAME_DEV='dev-iru-swarm.infoclinica.lan'
@@ -66,10 +68,14 @@ pipeline {
           git_clone(PKI_GIT_URL)
           git_clone(STACK_DEPLOY_GIT_URL)
           def NEW_ENDDATE = sh (script: "openssl x509 -enddate -noout -in ${CONFIG_DIR}/live/${DOMAIN}/cert.pem", returnStdout: true).trim()
+          ENDDATE = sh (script: "echo|openssl s_client -servername ${REGISTRY_PROD} -connect ${REGISTRY_PROD}:5000 2>/dev/null|openssl x509 -noout -enddate", returnStdout: true).trim()
           if (ENDDATE != NEW_ENDDATE) {
             echo "Update docker secret in ${CLUSTER_NAME_PROD}"
             def NODE_IP = sh (script: "DOCKER_HOST=tcp://${CLUSTER_NAME_PROD}:2376 DOCKER_TLS_VERIFY=1 docker node inspect self -f '{{.Status.Addr}}'" , returnStdout: true).trim()
             update_secret(NODE_IP, STACK_DEPLOY_GIT_NAME, DOMAIN, CONFIG_DIR)
+          }
+          ENDDATE = sh (script: "echo|openssl s_client -servername ${REGISTRY_DEV} -connect ${REGISTRY_DEV}:5000 2>/dev/null|openssl x509 -noout -enddate", returnStdout: true).trim()
+          if (ENDDATE != NEW_ENDDATE) {
             echo "Update docker secret in ${CLUSTER_NAME_DEV}"
             NODE_IP = sh (script: "DOCKER_HOST=tcp://${CLUSTER_NAME_DEV}:2376 DOCKER_TLS_VERIFY=1 docker node inspect self -f '{{.Status.Addr}}'" , returnStdout: true).trim()
             update_secret(NODE_IP, STACK_DEPLOY_GIT_NAME, DOMAIN, CONFIG_DIR)