Владимир Томишинец 5 년 전
부모
커밋
e5e34bbdb6
1개의 변경된 파일14개의 추가작업 그리고 5개의 파일을 삭제
  1. 14 5
      jenkinsfile.get.and.sync.dict

+ 14 - 5
jenkinsfile.get.and.sync.dict

@@ -134,7 +134,7 @@ pipeline {
                 }
             } 
         }
-*/        stage ("INVITRO dictionaries") {
+*//*        stage ("INVITRO dictionaries") {
             steps {
                 script {
                     INVITRONAMES.each { key, value ->
@@ -186,7 +186,7 @@ pipeline {
                 }
             }
         }
-/*        stage ("ALFA dictionaries") {
+*//*        stage ("ALFA dictionaries") {
             steps {
                 script {
                     ALFANAMES.each { key, value ->
@@ -269,16 +269,17 @@ pipeline {
                 }
             }
         }
-*//*        stage ("CMD dictionaries") {
+*/        stage ("CMD dictionaries") {
             steps {
                 script {
                     echo "Get dictionaries for CMD"
-                    sh """export DOCKER_HOST=tcp://$GOST_CLUSTER:2376 DOCKER_TLS_VERIFY=1
+/*                    sh """export DOCKER_HOST=tcp://$GOST_CLUSTER:2376 DOCKER_TLS_VERIFY=1
                           docker run --rm -i -v analis-wineservice_analis_Files_netapp:/services/ ${WGET_IMAGE} \
                             /bin/ash -c ' \
                             rm -fv /services/$CMD.dir/*.xml;
                             wget -P /services/$CMD.dir --user=$CMD.user --password=$CMD.pass $FTP.cmd'
                        """
+*/                  get(CMD.dir, CMD.user, CMD.pass, FTP.CMD, GOST_CLUSTER, WGET_IMAGE)                    
                     catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
                         timeout(time: 10 as Integer, unit: 'MINUTES') {
                             echo "Syncing dictionaries for CMD"
@@ -301,7 +302,7 @@ pipeline {
                 }
             }
         }
-*/    }
+    }
   
     post {
         always {
@@ -323,4 +324,12 @@ pipeline {
                 body: "<b>Congradulations!!!</b> <b><br> Jenkins job succefully finished.\n\n <b><br>Project Name:</b> ${env.JOB_NAME} <b><br>\nBuild Number:</b> ${env.BUILD_NUMBER} <b><br>\nURL Build:</b> ${RUN_DISPLAY_URL}"
         }
     }
+}
+def get(String dir, String user, String pass, String ftp, String CLUSTER, String IMAGE) {
+        sh """export DOCKER_HOST=tcp://$CLUSTER:2376 DOCKER_TLS_VERIFY=1
+              docker run --rm -i -v analis-wineservice_analis_Files_netapp:/services/ ${IMAGE} \
+                /bin/ash -c ' \
+                rm -fv /services/$dir/*.xml;
+                wget -P /services/$dir --user=$user --password=$pass $ftp'
+           """
 }