Browse Source

change jenkinsfiles.

Владимир Томишинец 5 years ago
parent
commit
a53daf3531
2 changed files with 10 additions and 4 deletions
  1. 5 2
      updateToTargetVersionJenkinsfile
  2. 5 2
      updateVersionJenkinsfile

+ 5 - 2
updateToTargetVersionJenkinsfile

@@ -60,7 +60,9 @@ pipeline {
         script {
           ENAMES.each { item ->
             echo "Viewing: ${item} services, on ${CLUSTERS.get((item))}"
-            LIST_SERVICE[item] = sh (script: "set +x && DOCKER_HOST=${DHOST.get((item))} DOCKER_TLS_VERIFY=1 docker service ls -f label=com.docker.stack.namespace=$STACK_LABEL -f label=ru.infoclinica.service=$SERVICE_LABEL --format '{{.Name}}'" , returnStdout: true).split('\n')
+            LIST_SERVICE[item] = sh (script: "set +x && DOCKER_HOST=${DHOST.get((item))} DOCKER_TLS_VERIFY=1 docker service ls -f \
+              label=com.docker.stack.namespace=$STACK_LABEL -f \
+              label=ru.infoclinica.service=$SERVICE_LABEL --format '{{.Name}}'" , returnStdout: true).split('\n')
             echo "These services will be updated ${LIST_SERVICE.get(item)} to version $toVersion"
           }
         }
@@ -75,7 +77,8 @@ pipeline {
               for (name in LIST_SERVICE.get(item)) {
                 TO_ROLLBACK[item].add(name)
                 echo "Update service $name"
-                sh "set +x && DOCKER_HOST=${DHOST.get((item))} DOCKER_TLS_VERIFY=1 docker service update $name --image ${REGISTRIES.get((item))}/lab/$DOCKER_IMAGE:$toVersion"
+                sh "set +x && DOCKER_HOST=${DHOST.get((item))} DOCKER_TLS_VERIFY=1 docker service update \
+                    $name --image ${REGISTRIES.get((item))}/lab/$DOCKER_IMAGE:$toVersion"
               }
             }
             catch (err) {

+ 5 - 2
updateVersionJenkinsfile

@@ -70,7 +70,9 @@ pipeline {
         script {
           ENAMES.each { item ->
             echo "Viewing: ${item} services, on ${CLUSTERS.get((item))}"
-            LIST_SERVICE[item] = sh (script: "set +x && DOCKER_HOST=${DHOST.get((item))} DOCKER_TLS_VERIFY=1 docker service ls -f label=com.docker.stack.namespace=$STACK_LABEL -f label=ru.infoclinica.service=$SERVICE_LABEL --format '{{.Name}}'" , returnStdout: true).split('\n')
+            LIST_SERVICE[item] = sh (script: "set +x && DOCKER_HOST=${DHOST.get((item))} DOCKER_TLS_VERIFY=1 docker service ls -f \
+              label=com.docker.stack.namespace=$STACK_LABEL -f \
+              label=ru.infoclinica.service=$SERVICE_LABEL --format '{{.Name}}'" , returnStdout: true).split('\n')
             switch (TASK_ACTION) {
               case 'up':
                 echo "These services will be updated to version $VERSION_TO_UPDATE: ${LIST_SERVICE.get(item)}"
@@ -92,7 +94,8 @@ pipeline {
               for (name in LIST_SERVICE.get(item)) {
                 TO_ROLLBACK[item].add(name)
                 echo "Update service $name"
-                sh "set +x && DOCKER_HOST=${DHOST.get((item))} DOCKER_TLS_VERIFY=1 docker service update $name --image ${REGISTRIES.get((item))}/lab/$DOCKER_IMAGE:$VERSION_TO_UPDATE"
+                sh "set +x && DOCKER_HOST=${DHOST.get((item))} DOCKER_TLS_VERIFY=1 docker service update \
+                    $name --image ${REGISTRIES.get((item))}/lab/$DOCKER_IMAGE:$VERSION_TO_UPDATE"
               }
             }
             catch (err) {