-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
71 lines (64 loc) · 1.84 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
pipeline {
agent none
stages {
stage('Node Build and Test') {
agent {
docker { image 'node:14-alpine' }
}
stages {
stage('Node build') {
steps {
sh 'echo \'Node Tests\''
dir("DotnetTemplate.Web") {
sh 'pwd'
sh 'npm install'
sh 'npm run build'
}
}
}
stage('Node Test') {
steps {
sh 'echo \'Node Tests\''
dir("DotnetTemplate.Web") {
sh 'pwd'
sh 'npm run lint'
sh 'npm t'
}
}
}
}
}
stage('.NET Build and Test') {
agent {
docker { image 'mcr.microsoft.com/dotnet/sdk:3.1' }
}
environment {
DOTNET_CLI_HOME = "/tmp/DOTNET_CLI_HOME"
}
stages {
stage('.NET Build') {
steps {
sh 'echo \'.NET Build\''
sh 'dotnet build'
}
}
stage('.NET Test') {
steps {
sh 'echo \'.NET Test\''
sh 'dotnet test'
}
}
}
}
}
post {
// only triggered when blue or green sign
success {
slackSend color: "good", message: "Build Success"
}
// triggered when red sign
failure {
slackSend color: "bad", message: "Build Failure!"
}
}
}