-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
34 lines (33 loc) · 1.01 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
library "[email protected]"
// pod provides common utilies and tools to jenkins-ptcs-library function correctly.
// certain ptcs-library command requires containers (like docker or gcloud.)
podTemplate(label: pod.label,
containers: pod.templates + [ // This adds all depencies for jenkins-ptcs-library methods to function correctly.
containerTemplate(name: 'dotnet', image: 'mcr.microsoft.com/dotnet/sdk:7.0', ttyEnabled: true, command: '/bin/sh -c', args: 'cat')
]
) {
node(pod.label) {
stage('Checkout') {
checkout scm
}
stage('Build') {
container('dotnet') {
sh """
dotnet build
"""
}
}
stage('Test') {
container('dotnet') {
sh """
dotnet test --framework=net7.0 Protacon.NetCore.WebApi.TestUtil.Tests
"""
}
}
stage('Package') {
container('dotnet') {
publishTagToNuget("Protacon.NetCore.WebApi.TestUtil")
}
}
}
}