forked from edgexfoundry/edgex-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
63 lines (60 loc) · 1.82 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 { label 'ubuntu18.04-docker-8c-8g' }
options {
timestamps()
disableConcurrentBuilds()
preserveStashes()
quietPeriod(5) // wait a few seconds before starting to aggregate multiple commits into a single build
durabilityHint 'PERFORMANCE_OPTIMIZED'
}
triggers {
issueCommentTrigger('.*^recheck$.*')
}
stages {
stage('Build Docs') {
agent {
dockerfile {
filename 'Dockerfile.docs'
reuseNode true
args '-u 0:0 --privileged --entrypoint='
}
}
steps {
script {
if ((env.BRANCH_NAME).startsWith('PR-')) {
env.ENABLED_HTMLPROOFER = true
}
retry(4) {
sh 'mkdocs build'
sh 'sleep 5' // add a little delay to avoid potential rate limiting issues
}
}
// stash the site contents generated from mkdocs build
stash name: 'site-contents', includes: 'docs/**', useDefaultExcludes: false
}
}
// back onto the main centos agent (not in docker container)
stage('Publish to GitHub pages') {
when {
beforeAgent true
expression { edgex.isReleaseStream() }
}
agent {
label 'centos7-docker-4c-2g'
}
steps {
script {
edgeXGHPagesPublish(repoUrl: '[email protected]:edgexfoundry/edgex-docs.git')
}
}
}
}
post {
always {
edgeXInfraPublish()
}
cleanup {
cleanWs()
}
}
}