forked from lidorg-dev/docker-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
57 lines (48 loc) · 1.09 KB
/
Jenkinsfile
File metadata and controls
57 lines (48 loc) · 1.09 KB
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
pipeline {
agent {
node {
label 'centos-docker'
}
}
stages {
stage('checkout code') {
steps {
cleanWs()
git(url: 'https://github.com/lidorg-dev/docker-demo.git', branch: 'master', poll: true, credentialsId: 'git-creds')
}
}
stage('docker build') {
parallel {
stage('docker build') {
steps {
sh "docker build -t node-app:${env.BUILD_ID} ."
}
}
stage('test') {
steps {
sh 'npm install && npm test'
}
}
}
}
stage('docker publish') {
steps {
sh "docker tag node-app:${env.BUILD_ID} lidorlg/node-app:${env.BUILD_ID} && docker push lidorlg/node-app:${env.BUILD_ID}"
}
}
stage('chuck norris') {
parallel {
stage('chuck norris') {
steps {
chuckNorris()
}
}
stage('notify slack ') {
steps {
slackSend(message: 'build succededs', color: '#BDFFC3', channel: '#sarabenshabbat_jenkins')
}
}
}
}
}
}