title: Check within Jenkinsfile if docker service exists
body: <p>I am setting up an CI Pipelin by means of Jenkins.</p>
  
  <p>I created the following Jenkinsfile:</p>
  
  <pre><code>pipeline {
  agent none
  
  stages {
      stage('Build and push image') {
          agent {
                  label 'man'
                }
          steps {
              sh 'docker image build -t login:stage .'
              sh 'docker tag login:stage 192.168.66.201:5000/login:stage'
              sh 'docker push 192.168.66.201:5000/login:stage'
          }
      }
      stage('Create Service') {
          agent {
                  label 'dev'
                }
          steps {
              sh 'docker service create --name loginService -p 40001:40001 --replicas=3  192.168.66.201:5000/login:stage'
          }
      }
  } 
  }
  </code></pre>
  
  <p>I know, I could use the components of docker (docker.withRegistry) but I like to do it manually in first attempt to exactly knew what happens.</p>
  
  <p>But my question is how to check in the "Create Service"-Stage, if a docker service already exists. If he exists I like to execute an update statement.</p>
  
  <p>You've got any idea? Using google or jenkins docs did not really helped me..</p>