-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
47 lines (46 loc) · 1.18 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
pipeline {
agent {
docker {
image 'registry.xsky.com/xsky/node-alpine-git'
}
}
stages {
stage('Prepare') {
steps {
script {
refName = ""
if (env.GIT_TAG_NAME) {
refName = env.GIT_TAG_NAME
} else {
refName = env.BRANCH_NAME
}
refName = refName.replace('/', '_').trim()
if (refName.length() == 0) {
echo "invalid refName: $refName"
sh "exit 1"
return
}
env.REF_NAME = refName
}
}
}
stage('Build') {
steps {
sh 'chmod +x build.sh && ./build.sh'
retry(2) {
sh 'chmod +x build-book.sh && ./build-book.sh'
}
}
}
stage('Delivery') {
steps {
sh 'chmod +x deliver.sh && ./deliver.sh'
}
}
}
post {
always {
deleteDir()
}
}
}