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

+ 18 - 16
jenkinsfile.get.and.sync.dict

@@ -125,22 +125,24 @@ 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') {
-                        timeout(time: 40 as Integer, unit: 'MINUTES') {
-                            INVITRONAMES.each { key, value -> 
-                                echo "Syncing $key"
-                                container_operate(GOST_CLUSTER, [ 'sync' ])
-                                def log_dir = value.dir.replace("Files", "LOGS")
-                                def dir = value.dir
-                                sh """printf '#!/bin/bash\ncd /root/wine32/dosdevices/unc/samba.infoclinica.lan/smartdelta01/$dir\n\
-                                      cat \$(ls -1t InvitroGetExtendedProduct_*.xml | head -n1) > InvitroGetExtendedProduct.xml\n\
-                                      cat \$(ls -1t InvitroGetInfo_*.xml | head -n1) > InvitroGetInfo.xml\n\
-                                      exec "/usr/bin/xvfb-run" "-a" "wine" "/opt/syncserver/SyncServer.exe" "\$@"' > entrypoint.sh
-                                      chmod +x entrypoint.sh
-                                   """
-                                syncServer(log_dir, value.idtask, SYNC_SERVER_IMAGE, GOST_CLUSTER)
-                            }
-                        }       
+                    INVITRONAMES.each { key, value -> 
+                        if (value.idtask) {
+                            container_operate(GOST_CLUSTER, [ 'sync' ])
+                            catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
+                                timeout(time: 10 as Integer, unit: 'MINUTES') {
+                                    echo "Syncing dictionaries for $key"
+                                    def log_dir = value.dir.replace("Files", "LOGS")
+                                    def dir = value.dir
+                                    sh """printf '#!/bin/bash\ncd /root/wine32/dosdevices/unc/samba.infoclinica.lan/smartdelta01/$dir\n\
+                                          cat \$(ls -1t InvitroGetExtendedProduct_*.xml | head -n1) > InvitroGetExtendedProduct.xml\n\
+                                          cat \$(ls -1t InvitroGetInfo_*.xml | head -n1) > InvitroGetInfo.xml\n\
+                                          exec "/usr/bin/xvfb-run" "-a" "wine" "/opt/syncserver/SyncServer.exe" "\$@"' > entrypoint.sh
+                                          chmod +x entrypoint.sh
+                                       """
+                                    syncServer(log_dir, value.idtask, SYNC_SERVER_IMAGE, GOST_CLUSTER)
+                                }
+                            }       
+                        }
                     }
                 }
             }