-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
62 lines (57 loc) · 1021 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
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
@Library('jenkins-shared') _
pipeline {
agent {
docker {
image 'squidfunk/mkdocs-material'
args '--entrypoint=""'
}
}
environment {
SLACK_CHANNEL_NAME = '#devops-alerts'
FAILURE_STAGE = 'Unknown'
}
stages {
stage('Init') {
steps {
script {
slack.start()
deploy = GIT_BRANCH=='origin/master'
}
}
post {
failure {
script { env.FAILURE_STAGE = 'Init' }
}
}
}
stage('Deploy') {
when {
expression { return deploy }
}
steps {
withCredentials([
string(credentialsId: 'github-devops-token', variable: 'GH_TOKEN')
]) {
sh 'mkdocs gh-deploy'
}
}
post {
failure {
script { env.FAILURE_STAGE = 'Deploy' }
}
}
}
}
post {
success {
script {
slack.success()
}
}
failure {
script {
slack.failure()
}
}
}
}