-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
65 lines (51 loc) · 1.4 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
pipeline {
agent any
options {
timeout(time: 1, unit: 'HOURS')
timestamps()
}
stages {
stage('develop branch') {
when {
branch 'develop'
}
steps {
echo 'multibranch pipeline project...'
}
}
stage('Spell Check') {
when {
branch 'master'
}
agent {
dockerfile {
filename 'Dockerfile.mdspell'
args '-u="root"'
reuseNode true
}
}
environment {
// mdspell uses chalk to color output.
// chalk uses a library called supports-color which auto-detects terminal support.
// this env var will force the library to use color.
FORCE_COLOR = "1";
}
steps {
echo 'Checking spelling...'
// mdspell -n -a -r --en-us "*.md" "*/*.md" "*/*/*.md"
sh '''
mdspell -n -a -r --en-us "./_posts/*.md"
'''
}
}
}
post {
unsuccessful {
echo 'Pipeline is unsuccessful!'
emailext(subject: "Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' ", body: "Job '<${env.BUILD_URL}>' Unsuccessful.", from: 'liuning0820@gmail.com',to: 'liuning0820@outlook.com')
}
always {
echo 'Pipeline Completed!'
}
}
}