-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.template
46 lines (38 loc) · 1.18 KB
/
Jenkinsfile.template
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
leancode.builder('exampleapp-template')
.withMonorepoTest(['backend', 'dev-cluster', 'infrastructure', '.template.config', 'FinalizeTemplate.proj', 'Jenkinsfile.template'])
.withDotnet([version: '8.0', image: 'mcr.microsoft.com/dotnet/sdk'])
.runOnSpot()
.run {
def scmVars
stage('Checkout') {
scmVars = safeCheckout scm
}
leancode.configureRepositories()
stage('Prepare workspace') {
env.DESTDIR = sh(script: 'mktemp -d', returnStdout: true).trim()
}
stage('Install template') {
container('dotnet') {
sh 'dotnet new install .'
}
}
stage('Create project') {
container('dotnet') {
sh '''
dotnet new create lncdproj --output "${DESTDIR}" --allow-scripts Yes --project-name NewProject --context Primary
'''
}
}
stage('Ensure all scripts are executable') {
sh '''
find "${DESTDIR}" -type f -name '*.sh' ! -executable -print -exec false '{}' +
'''
}
stage('Build backend') {
container('dotnet') {
sh '''
dotnet build "${DESTDIR}/backend"
'''
}
}
}