Browse Source

add syncserver

Владимир Томишинец 5 years ago
parent
commit
5fcad1c429
1 changed files with 22 additions and 6 deletions
  1. 22 6
      jenkinsfile.get.and.sync.dict

+ 22 - 6
jenkinsfile.get.and.sync.dict

@@ -71,6 +71,7 @@ pipeline {
         WGET_IMAGE='inutano/wget'
         SYNC_IMAGE='registry.infoclinica.ru:5000/syncmanager:i686.f30-0.2'
         ANALIS_IMAGE='registry.infoclinica.ru:5000/lab/analis-wineservice'
+        SYNC_SERVER_IMAGE='registry.infoclinica.ru:5000/syncserver:x64.f30-0.5'
         STACK_DEPLOY_REPO='ssh://git@git.sdsys.ru:8022/labportal/stack-deploy.git'
         mailto='admin@sdsys.ru'
     }
@@ -89,7 +90,7 @@ pipeline {
                 }
             }
         }
-/*        stage ("HELIX dictionaries") {
+        stage ("HELIX dictionaries") {
             steps {
                 script {
                     HELIXNAMES.each { key, value -> 
@@ -106,8 +107,9 @@ pipeline {
                                 timeout(time: 30 as Integer, unit: 'MINUTES') {
                                     echo "Syncing dictionaries for $key"
                                     def log_dir = value.dir.replace("Files", "LOGS")
-                                    log_dir = log_dir.replace("/", "\\")
-                                    sync(log_dir, value.idtask, SYNC_IMAGE, GOST_CLUSTER)
+                                    syncServer(log_dir, CMD.idtask, SYNC_SERVER_IMAGE, GOST_CLUSTER)
+//                                    log_dir = log_dir.replace("/", "\\")
+//                                    sync(log_dir, value.idtask, SYNC_IMAGE, GOST_CLUSTER)
                                 }
                             }
                         }
@@ -115,7 +117,7 @@ pipeline {
                 }
             } 
         }
-*//*        stage ("INVITRO dictionaries") {
+/*        stage ("INVITRO dictionaries") {
             steps {
                 script {
                     INVITRONAMES.each { key, value ->
@@ -151,7 +153,7 @@ pipeline {
                 }
             }
         }
-*/        stage ("ALFA dictionaries") {
+*//*        stage ("ALFA dictionaries") {
             steps {
                 script {
                     ALFANAMES.each { key, value ->
@@ -161,7 +163,7 @@ pipeline {
                         def log_dir = value.dir.replace("Files", "LOGS")
                         get_http(log_dir, value.id, ANALIS_IMAGE, TAG, GOST_CLUSTER)
                     }
-/*                    catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
+                    catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
                         timeout(time: 10 as Integer, unit: 'MINUTES') {
                             ALFANAMES.each { key, value -> 
                                 echo "Syncing $key"
@@ -196,6 +198,7 @@ pipeline {
                             echo "Syncing dictionaries for Gemotest"
                             container_operate(GOST_CLUSTER, [ 'sync' ])
                             def log_dir = GEMOTEST.dir.replace("Files", "LOGS")
+                            syncServer(log_dir, CMD.idtask, SYNC_SERVER_IMAGE, GOST_CLUSTER)
                             log_dir = log_dir.replace("/", "\\")
                             sync(log_dir, GEMOTEST.idtask, SYNC_IMAGE, GOST_CLUSTER)
                         }
@@ -213,6 +216,7 @@ pipeline {
                             echo "Syncing dictionaries for CMD"
                             container_operate(GOST_CLUSTER, [ 'sync' ])
                             def log_dir = CMD.dir.replace("Files", "LOGS")
+                            syncServer(log_dir, CMD.idtask, SYNC_SERVER_IMAGE, GOST_CLUSTER)
                             log_dir = log_dir.replace("/", "\\")
                             sync(log_dir, CMD.idtask, SYNC_IMAGE, GOST_CLUSTER)
                         }
@@ -254,6 +258,18 @@ def sync(String dir, String idtask, String IMAGE, String CLUSTER) {
               docker rm sync
            """
 }
+def syncServer(String dir, String idtask, String IMAGE, String CLUSTER) {
+        sh """export DOCKER_HOST=tcp://$CLUSTER:2376 DOCKER_TLS_VERIFY=1
+              docker create -i --name sync \
+                -v analis-wineservice_analis_Files_netapp:/root/wine32/dosdevices/unc/samba.infoclinica.lan/smartdelta01 \
+                --network=labnetwork ${IMAGE} -a prod_lab -e syncrefcode=$idtask \
+                logpath=/root/wine32/dosdevices/unc/samba.infoclinica.lan/smartdelta01/$dir /nocycles
+                docker cp infodent.ini sync:/opt/syncserver
+                docker cp sync.conf sync:/opt/syncserver
+                docker start -i sync
+                docker rm sync
+           """
+}
 def get_http(String dir, String id, String IMAGE, String TAG, String CLUSTER) {
         sh """export DOCKER_HOST=tcp://$CLUSTER:2376 DOCKER_TLS_VERIFY=1
               docker create -i --name get \