Tomishinets Vladimir 3 years ago
parent
commit
85a862d8a1
1 changed files with 15 additions and 15 deletions
  1. 15 15
      OFFICERenewalWildcardJenkinsfile

+ 15 - 15
OFFICERenewalWildcardJenkinsfile

@@ -61,21 +61,21 @@ pipeline {
     //     }
     //   }
     // }
-    // stage("Update docker secret in SWARM cluster") {
-    //   steps {
-    //     script {
-    //       gitOps.clone(PKI_GIT_URL)
-    //       gitOps.clone(SWARM_GIT_URL)
-    //       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_OFFICE} -connect ${REGISTRY_OFFICE}:443 2>/dev/null|openssl x509 -noout -enddate", returnStdout: true).trim()
-    //       if (ENDDATE != NEW_ENDDATE) {
-    //         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()
-    //         dockerWCrenewal.update_secret(NODE_IP, SWARM_GIT_NAME, DOMAIN, CONFIG_DIR)
-    //       }
-    //     }
-    //   }
-    // }
+    stage("Update docker secret in SWARM cluster") {
+      steps {
+        script {
+          gitOps.clone(PKI_GIT_URL)
+          gitOps.clone(SWARM_GIT_URL)
+          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_OFFICE} -connect ${REGISTRY_OFFICE}:443 2>/dev/null|openssl x509 -noout -enddate", returnStdout: true).trim()
+          if (ENDDATE != NEW_ENDDATE) {
+            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()
+            dockerWCrenewal.update_secret(NODE_IP, SWARM_GIT_NAME, DOMAIN, CONFIG_DIR)
+          }
+        }
+      }
+    }
     stage("Update certificate and key to Proxmox") {
       steps {
         script {