-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile_upload
161 lines (154 loc) · 6.14 KB
/
Jenkinsfile_upload
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
properties([
parameters([
choice(
name: 'snitflade',
choices: [
'Advis',
'2013_01_01',
'M*2015_01_01',
'E*2015_01_01',
'P*2015_01_01',
'M*2015_01_01_E1',
'P*2015_01_01_E1',
'M*2015_01_01_E2',
'P*2015_01_01_E2',
'E*2015_01_01_E2',
'M*2015_01_01_E4',
'M*2015_01_01_E5',
'P*2015_01_01_E5',
'E*2015_01_01_E5',
'M*2015_06_01',
'P*2015_06_01',
'M*2015_06_01_E2',
'P*2015_06_01_E2',
'M*2015_06_01_E3',
'M*2015_06_01_E5',
'P*2015_06_01_E5',
'M*2015_06_01_E6',
'2019_09_01',
'OrdinationsAI*_2022_03_01'
].join('\n')
,
description: '''
Kopierer den valgte snitflade til github.com/trifork/FMKResources. fmk.wiki udpeger disse ressourcer<br/>
<br/>
Advis -> Advis<br/>
dumpRestore -> 2013_01_01<br/>
dumpRestore2019 -> 2019_09_01<br/>
ordinationsAI -> 2022_03_01<br/>
1.4.4 -> 2015_01_01 (opdaterer også E1)<br/>
1.4.4_E1 -> 2015_01_01_E1<br/>
1.4.4_E2 -> 2015_01_01_E2<br/>
1.4.4_E4 -> 2015_01_01_E4<br/>
1.4.4_E5 -> 2015_01_01_E5<br/>
1.4.6 -> 2015_06_01<br/>
1.4.6_E1 -> 2015_06_01_E1<br/>
1.4.6_E2 -> 2015_06_01_E2<br/>
1.4.6_E3 -> 2015_06_01_E3<br/>
1.4.6_E5 -> 2015_06_01_E5<br/>
1.4.6_E6 -> 2015_06_01_E6<br/>
<br/>
Man releaser snitfladerne Medicinkortet, EffectuationOrdering og Patient(Organisation)Registration særskilt.
Dette gøres ved at vælge mellem hhv M*<I>snitflade</I>, E*<I>snitflade</I>, P*<I>snitflade</I>
'''
)
])
])
pipeline {
agent any
/*agent {
node {
label ''
customWorkspace '/var/jenkins_home/jobs/FMK_schema/workspace'
}
}*/
stages {
stage('Checkout') {
steps {
cleanWs()
checkout([$class: 'GitSCM', branches: [[name: "*/master"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'FMKResources']], submoduleCfg: [], userRemoteConfigs: [[url: '[email protected]:trifork/FMKResources.git']]])
}
}
stage('Copy Archive') {
steps {
script {
snitflade = snitflade.trim()
currentBuild.description = "${snitflade}"
try{
step ([$class: 'CopyArtifact',
projectName: 'FMK_schema',
filter: "**/standard/target/wsdl/*${snitflade}*.zip,**/target/idws/target/wsdl/*${snitflade}*.zip",
target: 'FMKResources/wsdl',
flatten: true]);
}
catch(exception) {
sh "echo CopyArtifact zip failed ${exception.toString()}"
}
try {
step([$class : 'CopyArtifact',
projectName: 'FMK_schema',
filter : "**/standard/target/wsdl/*${snitflade}*.wsdl,**/target/idws/target/wsdl/*${snitflade}*.wsdl",
target : 'FMKResources/tmp',
flatten : true]);
}
catch(exception) {
sh "echo CopyArtifact wsdl failed ${exception.toString()}"
}
}
}
}
stage('build') {
steps {
script {
String jenkinsUserId = sh(returnStdout: true, script: 'id -u jenkins').trim()
String dockerGroupId = sh(returnStdout: true, script: 'getent group docker | cut -d: -f3').trim()
String containerUserMapping = "-u $jenkinsUserId:$dockerGroupId "
docker.image("registry.fmk.netic.dk/fmk/fmkbuilder:11").inside(containerUserMapping) {
sh "echo ${snitflade} valgt"
sh '''
cd FMKResources/tmp
for f in *.wsdl
do
zip $f.zip $f
rm $f
done
cd ..
mv tmp/* wsdl/.
rm -r tmp
cd wsdl
md5sum *.zip > latest_md5
cd ..
git add *
git config user.email "[email protected]"
git config user.name "jenkins"
'''
sh "cd FMKResources && git commit -a -m release_${snitflade}"
}
}
}
}
}
post {
success {
script {
sh 'cd FMKResources && git push origin HEAD:master'
build job: 'FMK_publish_interfacedoc', wait:false, parameters: [string(name: 'snitflade', value: "${snitflade}")]
}
}
failure {
emailext body: '$DEFAULT_CONTENT',
recipientProviders: [culprits(), requestor()],
subject: '$DEFAULT_SUBJECT'
}
unstable {
emailext body: '$DEFAULT_CONTENT',
recipientProviders: [culprits(), requestor()],
subject: '$DEFAULT_SUBJECT'
}
fixed {
emailext body: '$DEFAULT_CONTENT',
recipientProviders: [culprits(), requestor()],
subject: '$DEFAULT_SUBJECT'
}
}
}