Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pipeline {
- agent any
- stages {
- stage('Pre-Build') {
- steps {
- bat 'powershell -Command "& {Get-ChildItem Env:}"'
- ws(dir: 'C:/J/TestSimulator') {
- deleteDir()
- checkout scm
- }
- }
- }
- stage('Build') {
- steps {
- ws(dir: 'C:/J/TestSimulator') {
- bat 'powershell -Command "& {ls}"'
- bat 'powershell -Command "& {nuget.exe restore}"'
- bat "\"${tool 'MSBuild'}\" TestSimulator.sln /p:Configuration=Release /p:Platform=\"Any CPU\" /p:ProductVersion=1.0.0.${env.BUILD_NUMBER}"
- }
- }
- }
- stage('Development Deploy') {
- steps {
- ws(dir: 'C:/J/TestSimulator') {
- bat 'powershell -Command "& {NET STOP TestSimulator}"'
- bat 'powershell -Command "& {Remove-Item C:/TestSimulator -Recurse -Force}"'
- bat 'powershell -Command "& {New-Item C:/TestSimulator -type directory}"'
- bat 'powershell -Command "& {Copy-Item Service/bin/Release/*.exe C:/TestSimulator}"'
- bat 'powershell -Command "& {Copy-Item Service/bin/Release/*.dll C:/TestSimulator}"'
- bat 'powershell -Command "& {Copy-Item Service/bin/Release/*.config C:/TestSimulator}"'
- bat 'powershell -Command "& {Copy-Item Service/bin/Release/WebContent C:/TestSimulator -Force -Recurse}"'
- withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'TestSimulatorDevDeployUser', usernameVariable: 'DEVUSERNAME', passwordVariable: 'DEVPASSWORD']]) {
- bat 'powershell -Command "& {C:/TestSimulator/TestSimulator.Service.exe install -username:.\\$ENV:DEVUSERNAME -password:$ENV:DEVPASSWORD}"'
- }
- bat 'powershell -Command "& {NET START TestSimulator}"'
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement