-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJenkinsfile
40 lines (38 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
#!/usr/bin/env groovy
pipeline {
agent { label 'site' }
stages {
stage('Build') {
steps {
sh "env"
script {
env.GIT_COMMIT_MSG = sh (
script: "git log --format=%B -n 1 ${env.GIT_COMMIT} | head -n 1",
returnStdout: true).trim()
env.GIT_AUTHOR_NAME = sh (
script: "git show -s --pretty=%an ${env.GIT_COMMIT}",
returnStdout: true).trim()
env.BUILD_INFO = "<${env.RUN_DISPLAY_URL}|${env.JOB_NAME} [${env.BUILD_NUMBER}]> submitted by ${env.GIT_AUTHOR_NAME} with commit <https://github.com/juji-io/docs/commit/${env.GIT_COMMIT}|${env.GIT_COMMIT.take(7)}>: ${env.GIT_COMMIT_MSG}"
}
sh '''
source ~/.bash_profile
mkdocs build
'''
}
}
}
post {
success {
slackSend (color: '#00FF00', message: "SUCCESSFUL: Job ${env.BUILD_INFO}")
}
aborted {
slackSend (color: '#FF00FF', message: "ABORTED: Job ${env.BUILD_INFO}")
}
notBuilt {
slackSend (color: '#AAAAAA', message: "NOT_BUILT: Job ${env.BUILD_INFO}")
}
unstable {
slackSend (color: '#FFFF00', message: "UNSTABLE: Job ${env.BUILD_INFO}")
}
}
}