forked from martinesmann/jenkins-ci-template
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Jenkinsfile
37 lines (32 loc) · 1.28 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
pipeline {
agent {
label 'windows-slave'
}
stages {
stage('checkout code') {
steps {
// One or more steps need to be included within the steps block.
cleanWs()
checkout scmGit(branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/lidorg-dev/jenkins-ci-template.git']])
}
}
stage('Install Dependency') {
steps {
powershell 'c:\\nuget\\nuget.exe restore src\\MyWindowsService -source "https://api.nuget.org/v3/index.json"'
}
}
stage('Compile & Deploy-Test') {
steps {
bat '''cd "c:\\Program Files (x86)\\MSBuild\\14.0\\Bin"
msbuild.exe c:\\jenkins\\workspace\\windows-ci\\src\\MyWindowsService\\MyWindowsService\\Deploy-Windows-Service-Via-MSBuild.proj'''
}
}
stage('Package') {
steps {
bat """cd "c:\\Program Files\\7-zip"
7z.exe a -r c:\\jenkins\\workspace\\windows-ci\\package-${env.BUILD_NUMBER}.zip c:\\jenkins\\workspace\\windows-ci\\*"""
archiveArtifacts artifacts: '*.zip', followSymlinks: false
}
}
}
}