Update Jenkinsfile

This commit is contained in:
AlexandrKharitonov 2021-05-27 09:34:16 +03:00
parent 3baaf63f54
commit 94fcfeae26

11
Jenkinsfile vendored
View File

@ -15,15 +15,19 @@ pipeline {
environment {
DESTSITE = 'testdeploy'
DESTHOST = '18.224.174.2'
LETTER = 'U:'
}
steps {
withCredentials([
usernamePassword(credentialsId: 'deploymentuser_pass', usernameVariable: 'deploymentuser', passwordVariable: 'deploymentpass')
])
{
bat '''
if not exist %LETTER% subst %LETTER% %WORKSPACE%
'''
bat '''
echo " == Build == "
%msbuild% %workspace%\\publish.proj /t:PrecompileWeb
%msbuild% %LETTER%\\publish.proj /t:PrecompileWeb
'''
powershell '''
$ErrorActionPreference='Stop'
@ -31,8 +35,9 @@ pipeline {
'''
bat '''
echo " == Deploy == "
%msdeployv2% -verb:sync -source:iisapp="%WORKSPACE%\\Precompiled" -dest:iisapp="%DESTSITE%",computerName="%DESTHOST%",username=%deploymentuser%,password=%deploymentpass% -preSync:runCommand="%WORKSPACE%\\sync.bat",waitInterval=120000 -postSync:runCommand="%WORKSPACE%\\sync.bat",waitInterval=120000
%msdeployv2% -verb:sync -source:iisapp="%LETTER%\\Precompiled" -dest:iisapp="%DESTSITE%",computerName="%DESTHOST%",username=%deploymentuser%,password=%deploymentpass% -preSync:runCommand="%LETTER%\\sync.bat",waitInterval=120000 -postSync:runCommand="%LETTER%\\sync.bat",waitInterval=120000
'''
bat 'subst %LETTER% /D'
}
}
}
@ -55,7 +60,7 @@ pipeline {
'''
bat '''
echo " == Deploy == "
%msdeployv2% -verb:sync -source:iisapp="%WORKSPACE%\\Precompiled" -dest:iisapp="%DESTSITE%",computerName="%DESTHOST%",username=%deploymentuser%,password=%deploymentpass% -preSync:runCommand="%WORKSPACE%\\sync.bat",waitInterval=120000 -postSync:runCommand="%WORKSPACE%\\sync.bat",waitInterval=120000
%msdeployv2% -verb:sync -source:iisapp="%LETTER%\\Precompiled" -dest:iisapp="%DESTSITE%",computerName="%DESTHOST%",username=%deploymentuser%,password=%deploymentpass% -preSync:runCommand="%LETTER%\\sync.bat",waitInterval=120000 -postSync:runCommand="%LETTER%\\sync.bat",waitInterval=120000
'''
}
}