-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
163 lines (148 loc) · 6.52 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
@Library("islog-helper") _
pipeline {
agent {
node {
label 'win2016'
customWorkspace "lla-swig"
}
}
options {
gitLabConnection('Gitlab Pontos')
disableConcurrentBuilds()
}
triggers {
gitlab(
triggerOnPush: true,
triggerOnMergeRequest: true,
branchFilterType: 'All',
)
}
environment {
CONAN_REVISIONS_ENABLED = 1
PACKAGE_NAME = "LogicalAccessSwig/2.4.2@islog/${BRANCH_NAME}"
}
stages {
stage('Full Swig') {
parallel {
stage("Linux Swig") {
stages {
/*
stage('Linux Swig Support Container') {
agent { label 'linux' }
steps {
sh "docker build --no-cache --pull -t docker-registry.islog.com:5000/swig-support:latest -f Dockerfile ."
sh "docker push docker-registry.islog.com:5000/swig-support:latest"
}
}
*/
// Only x64 release
stage('Linux Swig') {
agent {
docker {
alwaysPull true
image 'artifacts.linq.hidglobal.com:5000/debian_build_swig:latest'
}
}
steps {
script {
conan.withFreshWindowsConanCache {
sh "./build-linux.sh true"
dir('sources/LibLogicalAccessNet.win32') {
sh "mkdir build"
dir('build') {
sh 'conan install --profile compilers/x64_gcc10_release -o LLA_BUILD_PRIVATE=True -u ..'
sh 'conan build ..'
sh 'conan package ..'
sh "conan export-pkg --profile compilers/x64_gcc10_release -o LLA_BUILD_PRIVATE=True .. ${PACKAGE_NAME}"
sh "conan upload ${PACKAGE_NAME} -r islog-test --all --confirm --check --force"
}
}
}
}
}
}
}
}
stage('Window Swig') {
stages {
stage('Pre-Build') {
steps {
deleteDir()
checkout scm
script {
conan.withFreshWindowsConanCache {
powershell 'islog-prebuild'
}
}
dir('sources/scripts') {
bat 'pip install -r requirements.txt'
}
}
}
stage('Generate SWIG') {
steps {
// gitversion do not support vs2017 project for now https://github.com/GitTools/GitVersion/issues/1315
powershell 'sources/scripts/update-gitversion-vs2017proj.ps1 sources/LibLogicalAccessNet/LibLogicalAccessNet.csproj'
powershell 'sources/scripts/generate-swig.ps1'
}
}
stage('Build') {
steps {
dir('sources') {
powershell 'islog-build 0 Release'
}
dir('sources/LibLogicalAccessNet.win32') {
script {
conan.withFreshWindowsConanCache {
powershell './conan-build.ps1 -with_profile -build_private $True -build_nfc $True -build_rfidea $True -publish'
}
}
}
//warnings canComputeNew: false, canResolveRelativePaths: false, categoriesPattern: '', consoleParsers: [[parserName: 'MSBuild']], defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', messagesPattern: '', unHealthy: ''
}
}
stage('Package') {
steps {
powershell 'islog-sign'
powershell 'islog-package'
}
}
stage('Publish') {
steps {
powershell 'islog-publish sources/LibLogicalAccessNet.win32/bin $false $true'
}
}
}
}
}
}
}
post {
failure {
updateGitlabCommitStatus name: 'build', state: 'failed'
}
success {
updateGitlabCommitStatus name: 'build', state: 'success'
}
unstable {
updateGitlabCommitStatus name: 'build', state: 'success'
}
changed {
script {
if (currentBuild.currentResult == 'FAILURE' || currentBuild.currentResult == 'SUCCESS') {
// Other values: SUCCESS, UNSTABLE
// Send an email only if the build status has changed from green/unstable to red
emailext subject: '$DEFAULT_SUBJECT',
body: '$DEFAULT_CONTENT',
recipientProviders: [
[$class: 'CulpritsRecipientProvider'],
[$class: 'DevelopersRecipientProvider'],
[$class: 'RequesterRecipientProvider']
],
replyTo: '[email protected]',
to: '[email protected]'
}
}
}
}
}