| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 | 
							- import java.text.SimpleDateFormat
 
- pipeline {
 
-   agent {
 
-     label "dev-winservice"
 
-   }
 
-   options {
 
-         timeout(time: 3, unit: 'HOURS')
 
-   }
 
-   environment {
 
-     JENKINS_MAIL='jenkins@sdsys.ru'
 
-     REV_NUMBER=''
 
-   }
 
-   parameters {
 
-     string(
 
-       name: "mailto",
 
-       defaultValue: "admin@sdsys.ru",
 
-       description: "Email which has to be notified."
 
-     )
 
-   }
 
-   stages {
 
-     stage("Build docker image") {
 
-       steps {
 
-         // Checkout repository
 
-         powershell 'svn.exe checkout svn://192.168.21.250/programs/trunk/Services/Analis/Win64 Infoclinica --username public --password "sds#7753435"'
 
-         // Discover revision number
 
-         script {
 
-           REV_NUMBER = powershell(returnStdout: true, script: 'svn info --show-item last-changed-revision .\\Infoclinica').trim()
 
-           echo "Last-Changed-Revision number is '$REV_NUMBER'"
 
-         }
 
-         powershell """
 
-           Set-PSDebug -Trace 1
 
-           pwd
 
-           move-Item -Path .\\Infoclinica\\.svn -Destination ..\\svn
 
-           docker build -t analis-service:${REV_NUMBER}-${BUILD_NUMBER} .
 
-           move-Item -Path ..\\svn -Destination .\\Infoclinica\\.svn
 
-         """
 
-       }
 
-     }
 
-   }
 
-   post {
 
-     failure {
 
-       mail charset: 'UTF-8',
 
-            subject: "Jenkins dev-winservice docker image build ERROR",
 
-            mimeType: 'text/html',
 
-            to: "${mailto}",
 
-            body: "<b>ATTENTION!!!</b> <b><br> Jenkins job failed.\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}"
 
-     }
 
-     success {
 
-       mail charset: 'UTF-8',
 
-            subject: "Jenkins dev-winservice docker image build SUCCESS",
 
-            mimeType: 'text/html',
 
-            to: "${mailto}",
 
-            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}"
 
-     }
 
-   }
 
- }
 
 
  |