1 |
8e4fb3e4
|
Milan Hotovec
|
#CI_COMMIT_MESSAGE is header and description
|
2 |
|
|
#Only childs are ANDed and child restrictions are ORed
|
3 |
|
|
variables:
|
4 |
|
|
RELEASE_FOLDER: "C:\\Users\\cztestman01\\OneDrive - Leuze electronic GmbH + Co. KG\\00_BUILDS\\DummyProject"
|
5 |
|
|
stages:
|
6 |
|
|
- build
|
7 |
|
|
- test
|
8 |
00284780
|
Milan Hotovec
|
- release
|
9 |
8e4fb3e4
|
Milan Hotovec
|
before_script:
|
10 |
2fed27a9
|
Milan Hotovec
|
- 'echo "Execution time"' # Current time
|
11 |
|
|
- 'date'
|
12 |
|
|
#Job for building on windows
|
13 |
|
|
build_job_windows:
|
14 |
8e4fb3e4
|
Milan Hotovec
|
stage: build
|
15 |
|
|
tags:
|
16 |
2fed27a9
|
Milan Hotovec
|
- dotnet
|
17 |
|
|
- windows10
|
18 |
8e4fb3e4
|
Milan Hotovec
|
only:
|
19 |
|
|
refs:
|
20 |
|
|
- branches
|
21 |
|
|
variables:
|
22 |
2fed27a9
|
Milan Hotovec
|
- $CI_COMMIT_MESSAGE =~ /@build/i #manual trigger for building
|
23 |
8e4fb3e4
|
Milan Hotovec
|
- $CI_COMMIT_MESSAGE =~ /@test/i #manual trigger for testing
|
24 |
|
|
- $CI_COMMIT_MESSAGE =~ /@deploy/i #manual trigger for deploy
|
25 |
|
|
- $CI_COMMIT_MESSAGE =~ /See merge request/ #auto trigger for merge requests from GitLab
|
26 |
|
|
- $CI_COMMIT_MESSAGE =~ /merge branch/i #auto trigger for merge requests from command
|
27 |
|
|
- $CI_COMMIT_MESSAGE =~ /Merge remote-tracking branch/i #auto trigger for remote merge requests from command
|
28 |
|
|
script:
|
29 |
cca21d23
|
Milan Hotovec
|
- 'dotnet build' #Build project
|
30 |
8e4fb3e4
|
Milan Hotovec
|
artifacts:
|
31 |
|
|
expire_in: 2 days
|
32 |
|
|
paths:
|
33 |
4e6e3058
|
Milan Hotovec
|
- '.\src\Presentation\Leuze.App\bin\Debug\net5.0' #Upload all builds as artifact
|
34 |
2fed27a9
|
Milan Hotovec
|
- '.\src\Presentation\Leuze.Modules\net5.0' #Upload all builds as artifact
|
35 |
|
|
#Job for building on linux
|
36 |
|
|
build_job_linux:
|
37 |
|
|
stage: build
|
38 |
|
|
tags:
|
39 |
|
|
- dotnet
|
40 |
|
|
- linux
|
41 |
|
|
only:
|
42 |
|
|
refs:
|
43 |
|
|
- branches
|
44 |
|
|
variables:
|
45 |
|
|
- $CI_COMMIT_MESSAGE =~ /@build/i #manual trigger for building
|
46 |
|
|
- $CI_COMMIT_MESSAGE =~ /@test/i #manual trigger for testing
|
47 |
|
|
- $CI_COMMIT_MESSAGE =~ /@deploy/i #manual trigger for deploy
|
48 |
|
|
- $CI_COMMIT_MESSAGE =~ /See merge request/ #auto trigger for merge requests from GitLab
|
49 |
|
|
- $CI_COMMIT_MESSAGE =~ /merge branch/i #auto trigger for merge requests from command
|
50 |
|
|
- $CI_COMMIT_MESSAGE =~ /Merge remote-tracking branch/i #auto trigger for remote merge requests from command
|
51 |
|
|
script:
|
52 |
|
|
- 'dotnet build' #Build project
|
53 |
|
|
artifacts:
|
54 |
|
|
expire_in: 2 days
|
55 |
|
|
paths:
|
56 |
b816322f
|
Milan Hotovec
|
- './src/Presentation/Leuze.App/bin/Debug/net5.0' #Upload all builds as artifact
|
57 |
|
|
- './src/Presentation/Leuze.Modules/net5.0' #Upload all builds as artifact
|
58 |
2fed27a9
|
Milan Hotovec
|
#Job for testing windows
|
59 |
|
|
test_job_windows:
|
60 |
8e4fb3e4
|
Milan Hotovec
|
stage: test
|
61 |
b816322f
|
Milan Hotovec
|
needs: ["build_job_windows"]
|
62 |
8e4fb3e4
|
Milan Hotovec
|
tags:
|
63 |
2fed27a9
|
Milan Hotovec
|
- dotnet
|
64 |
|
|
- windows10
|
65 |
8e4fb3e4
|
Milan Hotovec
|
only:
|
66 |
|
|
refs:
|
67 |
|
|
- branches
|
68 |
|
|
variables:
|
69 |
2fed27a9
|
Milan Hotovec
|
- $CI_COMMIT_MESSAGE =~ /@testWindows/i #manual trigger for testing
|
70 |
8e4fb3e4
|
Milan Hotovec
|
- $CI_COMMIT_MESSAGE =~ /@deploy/i #manual trigger for deploy
|
71 |
|
|
- $CI_COMMIT_MESSAGE =~ /@testFull/i #manual trigger for testing full
|
72 |
|
|
- $CI_COMMIT_MESSAGE =~ /See merge request/ #auto trigger for merge requests from GitLab
|
73 |
|
|
- $CI_COMMIT_MESSAGE =~ /merge branch/i #auto trigger for merge requests from command
|
74 |
|
|
- $CI_COMMIT_MESSAGE =~ /Merge remote-tracking branch/i #auto trigger for remote merge requests from command
|
75 |
|
|
script:
|
76 |
e30b109f
|
Silentkiller159
|
- 'dotnet test --collect:"XPlat Code Coverage" -r "./TestResults/"' #Run tests using console mode of MSTest (Unit)¨
|
77 |
e7a035b0
|
Silentkiller159
|
- 'reportgenerator "-reports:.\TestResults\*\coverage.cobertura.xml" "-targetdir:coveragereport" -reporttypes:Html'
|
78 |
|
|
- '(Get-Content .\coveragereport\index.html) -match "Line coverage:"'
|
79 |
72bfdf90
|
Silentkiller159
|
artifacts:
|
80 |
|
|
expire_in: 2 days
|
81 |
e7a035b0
|
Silentkiller159
|
paths:
|
82 |
|
|
- './coveragereport'
|
83 |
d519938c
|
Silentkiller159
|
reports:
|
84 |
e30b109f
|
Silentkiller159
|
cobertura:
|
85 |
c8ad47ed
|
Silentkiller159
|
- ./TestResults/*/*.xml
|
86 |
d519938c
|
Silentkiller159
|
|
87 |
2fed27a9
|
Milan Hotovec
|
#Job for testing linux
|
88 |
|
|
test_job_linux:
|
89 |
|
|
stage: test
|
90 |
b816322f
|
Milan Hotovec
|
needs: ["build_job_linux"]
|
91 |
8e4fb3e4
|
Milan Hotovec
|
tags:
|
92 |
2fed27a9
|
Milan Hotovec
|
- dotnet
|
93 |
|
|
- linux
|
94 |
8e4fb3e4
|
Milan Hotovec
|
only:
|
95 |
|
|
refs:
|
96 |
2fed27a9
|
Milan Hotovec
|
- branches
|
97 |
8e4fb3e4
|
Milan Hotovec
|
variables:
|
98 |
2fed27a9
|
Milan Hotovec
|
- $CI_COMMIT_MESSAGE =~ /@testLinux/i #manual trigger for testing
|
99 |
|
|
- $CI_COMMIT_MESSAGE =~ /@deploy/i #manual trigger for deploy
|
100 |
|
|
- $CI_COMMIT_MESSAGE =~ /@testFull/i #manual trigger for testing full
|
101 |
8e4fb3e4
|
Milan Hotovec
|
- $CI_COMMIT_MESSAGE =~ /See merge request/ #auto trigger for merge requests from GitLab
|
102 |
|
|
- $CI_COMMIT_MESSAGE =~ /merge branch/i #auto trigger for merge requests from command
|
103 |
|
|
- $CI_COMMIT_MESSAGE =~ /Merge remote-tracking branch/i #auto trigger for remote merge requests from command
|
104 |
|
|
script:
|
105 |
2fed27a9
|
Milan Hotovec
|
- 'dotnet test' #Run tests using console mode of MSTest (Unit)
|
106 |
1e660823
|
Milan Hotovec
|
#Job for release manual windows
|
107 |
|
|
release_manual_job_windows:
|
108 |
|
|
stage: release
|
109 |
|
|
needs: ["test_job_windows"]
|
110 |
|
|
tags:
|
111 |
|
|
- dotnet
|
112 |
|
|
- windows10
|
113 |
|
|
only:
|
114 |
|
|
refs:
|
115 |
|
|
- branches
|
116 |
|
|
variables:
|
117 |
|
|
- $CI_COMMIT_MESSAGE =~ /@deploy/i #manual trigger for testing
|
118 |
|
|
script:
|
119 |
|
|
- 'dotnet publish'
|
120 |
|
|
- '$today = (Get-Date).ToString("yyyy_MM_dd-HH_mm_ss")'
|
121 |
|
|
- '& mkdir "deploy/modules"'
|
122 |
e44123e8
|
Milan Hotovec
|
- '& echo "Build time: $today`n" > deploy\00_buildLog.txt'
|
123 |
1e660823
|
Milan Hotovec
|
- '& echo "Build branch: $CI_COMMIT_BRANCH`n" >> deploy\00_buildLog.txt'
|
124 |
|
|
- '& echo "Pipeline: $CI_PIPELINE_URL`n" >> deploy\00_buildLog.txt'
|
125 |
|
|
- '& echo "Pipeline trigger source: $CI_PIPELINE_SOURCE`n" >> deploy\00_buildLog.txt'
|
126 |
|
|
- '& echo "Runner: $CI_RUNNER_DESCRIPTION`n" >> deploy\00_buildLog.txt'
|
127 |
|
|
- '& echo "Description: $CI_COMMIT_MESSAGE`n" >> deploy\00_buildLog.txt'
|
128 |
e44123e8
|
Milan Hotovec
|
- '& xcopy /y /s ".\src\Presentation\Leuze.App\bin\Debug\net5.0\publish\*.*" "deploy"'
|
129 |
|
|
- '& xcopy /y /s ".\src\Presentation\Leuze.Modules\net5.0\publish\*.*" "deploy\modules"'
|
130 |
1e660823
|
Milan Hotovec
|
artifacts:
|
131 |
|
|
name: "Manual Deploy artifact - windows"
|
132 |
|
|
expire_in: 30 days
|
133 |
|
|
paths:
|
134 |
|
|
- '.\deploy'
|
135 |
|
|
#Job for release developmental windows
|
136 |
|
|
release_developmental_job_windows:
|
137 |
|
|
stage: release
|
138 |
|
|
needs: ["test_job_windows"]
|
139 |
|
|
tags:
|
140 |
|
|
- dotnet
|
141 |
|
|
- windows10
|
142 |
|
|
only:
|
143 |
|
|
refs:
|
144 |
|
|
- dev
|
145 |
|
|
variables:
|
146 |
|
|
- $CI_COMMIT_MESSAGE =~ /See merge request/ #auto trigger for merge requests from GitLab
|
147 |
|
|
- $CI_COMMIT_MESSAGE =~ /merge branch/i #auto trigger for merge requests from command
|
148 |
|
|
- $CI_COMMIT_MESSAGE =~ /Merge remote-tracking branch/i #auto trigger for remote merge requests from command
|
149 |
|
|
script:
|
150 |
|
|
- 'dotnet publish'
|
151 |
|
|
- '$today = (Get-Date).ToString("yyyy_MM_dd-HH_mm_ss")'
|
152 |
|
|
- '& mkdir "deploy/modules"'
|
153 |
e44123e8
|
Milan Hotovec
|
- '& echo "Build time: $today`n" > deploy\00_buildLog.txt'
|
154 |
1e660823
|
Milan Hotovec
|
- '& echo "Build branch: $CI_COMMIT_BRANCH`n" >> deploy\00_buildLog.txt'
|
155 |
|
|
- '& echo "Pipeline: $CI_PIPELINE_URL`n" >> deploy\00_buildLog.txt'
|
156 |
|
|
- '& echo "Pipeline trigger source: $CI_PIPELINE_SOURCE`n" >> deploy\00_buildLog.txt'
|
157 |
|
|
- '& echo "Runner: $CI_RUNNER_DESCRIPTION`n" >> deploy\00_buildLog.txt'
|
158 |
|
|
- '& echo "Description: $CI_COMMIT_MESSAGE`n" >> deploy\00_buildLog.txt'
|
159 |
e44123e8
|
Milan Hotovec
|
- '& xcopy /y /s ".\src\Presentation\Leuze.App\bin\Debug\net5.0\publish\*.*" "deploy"'
|
160 |
|
|
- '& xcopy /y /s ".\src\Presentation\Leuze.Modules\net5.0\publish\*.*" "deploy\modules"'
|
161 |
1e660823
|
Milan Hotovec
|
artifacts:
|
162 |
|
|
name: "Developmental Deploy artifact - windows"
|
163 |
|
|
expire_in: 30 days
|
164 |
|
|
paths:
|
165 |
|
|
- '.\deploy'
|
166 |
|
|
#Job for release master windows
|
167 |
|
|
release_master_job_windows:
|
168 |
|
|
stage: release
|
169 |
|
|
needs: ["test_job_windows"]
|
170 |
|
|
tags:
|
171 |
|
|
- dotnet
|
172 |
|
|
- windows10
|
173 |
|
|
only:
|
174 |
|
|
refs:
|
175 |
|
|
- master
|
176 |
|
|
variables:
|
177 |
|
|
- $CI_COMMIT_MESSAGE =~ /See merge request/ #auto trigger for merge requests from GitLab
|
178 |
|
|
- $CI_COMMIT_MESSAGE =~ /merge branch/i #auto trigger for merge requests from command
|
179 |
|
|
- $CI_COMMIT_MESSAGE =~ /Merge remote-tracking branch/i #auto trigger for remote merge requests from command
|
180 |
|
|
script:
|
181 |
|
|
- 'dotnet publish'
|
182 |
|
|
- '$today = (Get-Date).ToString("yyyy_MM_dd-HH_mm_ss")'
|
183 |
|
|
- '& mkdir "deploy/modules"'
|
184 |
e44123e8
|
Milan Hotovec
|
- '& echo "Build time: $today`n" > deploy\00_buildLog.txt'
|
185 |
1e660823
|
Milan Hotovec
|
- '& echo "Build branch: $CI_COMMIT_BRANCH`n" >> deploy\00_buildLog.txt'
|
186 |
|
|
- '& echo "Pipeline: $CI_PIPELINE_URL`n" >> deploy\00_buildLog.txt'
|
187 |
|
|
- '& echo "Pipeline trigger source: $CI_PIPELINE_SOURCE`n" >> deploy\00_buildLog.txt'
|
188 |
|
|
- '& echo "Runner: $CI_RUNNER_DESCRIPTION`n" >> deploy\00_buildLog.txt'
|
189 |
|
|
- '& echo "Description: $CI_COMMIT_MESSAGE`n" >> deploy\00_buildLog.txt'
|
190 |
e44123e8
|
Milan Hotovec
|
- '& xcopy /y /s ".\src\Presentation\Leuze.App\bin\Debug\net5.0\publish\*.*" "deploy"'
|
191 |
|
|
- '& xcopy /y /s ".\src\Presentation\Leuze.Modules\net5.0\publish\*.*" "deploy\modules"'
|
192 |
1e660823
|
Milan Hotovec
|
artifacts:
|
193 |
|
|
name: "Master Deploy artifact - windows"
|
194 |
|
|
expire_in: 30 days
|
195 |
|
|
paths:
|
196 |
|
|
- '.\deploy'
|
197 |
|
|
#Job for release manual linux
|
198 |
|
|
release_manual_job_linux:
|
199 |
|
|
stage: release
|
200 |
|
|
needs: ["test_job_linux"]
|
201 |
|
|
tags:
|
202 |
|
|
- dotnet
|
203 |
|
|
- linux
|
204 |
|
|
only:
|
205 |
|
|
refs:
|
206 |
|
|
- branches
|
207 |
|
|
variables:
|
208 |
|
|
- $CI_COMMIT_MESSAGE =~ /@deploy/i #manual trigger for testing
|
209 |
|
|
script:
|
210 |
|
|
- 'dotnet publish'
|
211 |
d7393436
|
Milan Hotovec
|
- 'today=$(date)'
|
212 |
e44123e8
|
Milan Hotovec
|
- 'mkdir -p "./deploy/modules"'
|
213 |
2bc4fdec
|
Milan Hotovec
|
- 'echo -e "Build time: $today\n" > ./deploy/00_buildLog.txt'
|
214 |
|
|
- 'echo -e "Build branch: $CI_COMMIT_BRANCH\n" >> ./deploy/00_buildLog.txt'
|
215 |
|
|
- 'echo -e "Pipeline: $CI_PIPELINE_URL\n" >> ./deploy/00_buildLog.txt'
|
216 |
|
|
- 'echo -e "Pipeline trigger source: $CI_PIPELINE_SOURCE\n" >> ./deploy/00_buildLog.txt'
|
217 |
|
|
- 'echo -e "Runner: $CI_RUNNER_DESCRIPTION\n" >> ./deploy/00_buildLog.txt'
|
218 |
|
|
- 'echo -e "Description: $CI_COMMIT_MESSAGE\n" >> ./deploy/00_buildLog.txt'
|
219 |
a052326f
|
Milan Hotovec
|
- 'cp -r "./src/Presentation/Leuze.App/bin/Debug/net5.0/publish/." "./deploy"'
|
220 |
|
|
- 'cp -r "./src/Presentation/Leuze.Modules/net5.0/publish/." "./deploy/modules"'
|
221 |
1e660823
|
Milan Hotovec
|
artifacts:
|
222 |
|
|
name: "Manual Deploy artifact - linux"
|
223 |
|
|
expire_in: 30 days
|
224 |
|
|
paths:
|
225 |
|
|
- './deploy'
|
226 |
|
|
#Job for release developmental linux
|
227 |
|
|
release_developmental_job_linux:
|
228 |
|
|
stage: release
|
229 |
|
|
needs: ["test_job_linux"]
|
230 |
|
|
tags:
|
231 |
|
|
- dotnet
|
232 |
|
|
- linux
|
233 |
|
|
only:
|
234 |
|
|
refs:
|
235 |
|
|
- dev
|
236 |
|
|
variables:
|
237 |
|
|
- $CI_COMMIT_MESSAGE =~ /See merge request/ #auto trigger for merge requests from GitLab
|
238 |
|
|
- $CI_COMMIT_MESSAGE =~ /merge branch/i #auto trigger for merge requests from command
|
239 |
|
|
- $CI_COMMIT_MESSAGE =~ /Merge remote-tracking branch/i #auto trigger for remote merge requests from command
|
240 |
|
|
script:
|
241 |
|
|
- 'dotnet publish'
|
242 |
d7393436
|
Milan Hotovec
|
- 'today=$(date)'
|
243 |
e44123e8
|
Milan Hotovec
|
- 'mkdir -p "./deploy/modules"'
|
244 |
2bc4fdec
|
Milan Hotovec
|
- 'echo -e "Build time: $today\n" > ./deploy/00_buildLog.txt'
|
245 |
|
|
- 'echo -e "Build branch: $CI_COMMIT_BRANCH\n" >> ./deploy/00_buildLog.txt'
|
246 |
|
|
- 'echo -e "Pipeline: $CI_PIPELINE_URL\n" >> ./deploy/00_buildLog.txt'
|
247 |
|
|
- 'echo -e "Pipeline trigger source: $CI_PIPELINE_SOURCE\n" >> ./deploy/00_buildLog.txt'
|
248 |
|
|
- 'echo -e "Runner: $CI_RUNNER_DESCRIPTION\n" >> ./deploy/00_buildLog.txt'
|
249 |
|
|
- 'echo -e "Description: $CI_COMMIT_MESSAGE\n" >> ./deploy/00_buildLog.txt'
|
250 |
a052326f
|
Milan Hotovec
|
- 'cp -r "./src/Presentation/Leuze.App/bin/Debug/net5.0/publish/." "./deploy"'
|
251 |
|
|
- 'cp -r "./src/Presentation/Leuze.Modules/net5.0/publish/." "./deploy/modules"'
|
252 |
1e660823
|
Milan Hotovec
|
artifacts:
|
253 |
|
|
name: "Developmental Deploy artifact - linux"
|
254 |
|
|
expire_in: 30 days
|
255 |
|
|
paths:
|
256 |
|
|
- './deploy'
|
257 |
|
|
#Job for release master linux
|
258 |
|
|
release_master_job_linux:
|
259 |
|
|
stage: release
|
260 |
|
|
needs: ["test_job_linux"]
|
261 |
|
|
tags:
|
262 |
|
|
- dotnet
|
263 |
|
|
- linux
|
264 |
|
|
only:
|
265 |
|
|
refs:
|
266 |
|
|
- master
|
267 |
|
|
variables:
|
268 |
|
|
- $CI_COMMIT_MESSAGE =~ /See merge request/ #auto trigger for merge requests from GitLab
|
269 |
|
|
- $CI_COMMIT_MESSAGE =~ /merge branch/i #auto trigger for merge requests from command
|
270 |
|
|
- $CI_COMMIT_MESSAGE =~ /Merge remote-tracking branch/i #auto trigger for remote merge requests from command
|
271 |
|
|
script:
|
272 |
|
|
- 'dotnet publish'
|
273 |
d7393436
|
Milan Hotovec
|
- 'today=$(date)'
|
274 |
e44123e8
|
Milan Hotovec
|
- 'mkdir -p "./deploy/modules"'
|
275 |
2bc4fdec
|
Milan Hotovec
|
- 'echo -e "Build time: $today\n" > ./deploy/00_buildLog.txt'
|
276 |
|
|
- 'echo -e "Build branch: $CI_COMMIT_BRANCH\n" >> ./deploy/00_buildLog.txt'
|
277 |
|
|
- 'echo -e "Pipeline: $CI_PIPELINE_URL\n" >> ./deploy/00_buildLog.txt'
|
278 |
|
|
- 'echo -e "Pipeline trigger source: $CI_PIPELINE_SOURCE\n" >> ./deploy/00_buildLog.txt'
|
279 |
|
|
- 'echo -e "Runner: $CI_RUNNER_DESCRIPTION\n" >> ./deploy/00_buildLog.txt'
|
280 |
|
|
- 'echo -e "Description: $CI_COMMIT_MESSAGE\n" >> ./deploy/00_buildLog.txt'
|
281 |
a052326f
|
Milan Hotovec
|
- 'cp -r "./src/Presentation/Leuze.App/bin/Debug/net5.0/publish/." "./deploy"'
|
282 |
|
|
- 'cp -r "./src/Presentation/Leuze.Modules/net5.0/publish/." "./deploy/modules"'
|
283 |
1e660823
|
Milan Hotovec
|
artifacts:
|
284 |
|
|
name: "Master Deploy artifact - linux"
|
285 |
|
|
expire_in: 30 days
|
286 |
|
|
paths:
|
287 |
|
|
- './deploy'
|