| 
					
				 | 
			
			
				@@ -26,7 +26,7 @@ pipeline { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   stages { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     stage("SVN Checkout") { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       steps { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        sh """svn cleanup analis 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        sh """[ -d analis/.svn ] && svn cleanup analis 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               svn co --force --no-auth-cache svn://192.168.21.250/programs/trunk/Services/Analis/Win32 analis --username public --password "sds#7753435" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            """ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -35,7 +35,7 @@ pipeline { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       steps { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         script { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           // Discover revision number 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          REV_NUMBER=sh(returnStdout: true, script: 'docker run --rm -v $(pwd):/repository registry.sdsys.ru/alpine-svn:0.3 info --show-item last-changed-revision analis').trim 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          REV_NUMBER=sh (script: "svn info --show-item last-changed-revision analis", returnStdout: true ).trim() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           echo "Last-Changed-Revision number is '$REV_NUMBER'" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         sh "docker build -t ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${REV_NUMBER}-${BUILD_NUMBER} ." 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -51,9 +51,10 @@ pipeline { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     stage("Tagging"){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       steps{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         withCredentials([sshUserPrivateKey(credentialsId: 'provision', keyFileVariable: 'GIT_SSH_KEY', passphraseVariable: '', usernameVariable: 'GIT_SSH_USERNAME')]) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          sh """GIT_SSH_COMMAND='ssh -i ${GIT_SSH_KEY} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          sh """[ -d ${SWARM_GIT_NAME} ] && rm -rf ${SWARM_GIT_NAME} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                GIT_SSH_COMMAND='ssh -i ${GIT_SSH_KEY} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 git clone ${SWARM_GIT_URL} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                pushd ${SWARM_GIT_NAME} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                cd ${SWARM_GIT_NAME} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 echo -n ${REV_NUMBER}-${BUILD_NUMBER} > tags/${DOCKER_IMAGE}.build-version 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 git add -A 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 git config --global user.email "${JENKINS_MAIL}" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -61,7 +62,7 @@ pipeline { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 git commit -m "Version update tags/lab/${DOCKER_IMAGE}.build-version = ${REV_NUMBER}-${BUILD_NUMBER}" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 GIT_SSH_COMMAND='ssh -i ${GIT_SSH_KEY} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 git push origin master 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                popd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                cd .. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 rm -rf ${SWARM_GIT_NAME} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 ls""" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 |