-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
37 lines (35 loc) · 812 Bytes
/
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
pipeline{
agent{
label "nodejs"
}
stages{
stage("Install dependencies"){
steps{
sh "npm ci"
}
}
stage("Check Style"){
steps{
sh "npm run lint"
}
}
stage("Test"){
steps{
sh "npm test"
}
}
stage("Build-Docker-Image"){
steps{
script{
def imageName = "my-app:${env.BUILD_NUMBER}"
sh """
docker build -t ${imageName} .
docker push registry/image:v1
docker rmi -f \$(docker images -q) || true
"""
}
}
}
// Add the Release stage here
}
}