-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathJenkinsfile
73 lines (66 loc) · 2.46 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
64
65
66
67
68
69
70
71
72
73
pipeline {
agent {
label 'documentation'
}
environment {
ANTORA_VERSION = 'antora/antora:3.1.9'
}
stages {
stage('Community Documentation Preview') {
steps {
script {
// Ensure Docker is running
sh "sudo systemctl start docker || true"
// Run Antora for community-local-playbook.yml
sh """
sudo docker run --entrypoint antora -v ${WORKSPACE}:/antora -u 1000 --rm -t ${env.ANTORA_VERSION} generate --stacktrace community-local-playbook.yml
"""
}
}
}
stage('Enterprise Documentation Preview') {
steps {
script {
// Ensure Docker is running
sh "sudo systemctl start docker || true"
// Run Antora for enterprise-local-playbook.yml
sh """
sudo docker run --entrypoint antora -v ${WORKSPACE}:/antora -u 1000 --rm -t ${env.ANTORA_VERSION} generate --stacktrace enterprise-local-playbook.yml
"""
}
}
}
stage('Archive and Publish Generated Docs') {
steps {
// Archive community and enterprise docs as Jenkins artifacts
archiveArtifacts artifacts: 'build/community/html/**', allowEmptyArchive: true
archiveArtifacts artifacts: 'build/enterprise/html/**', allowEmptyArchive: true
// Publish HTML reports
publishHTML([
reportName: 'Community Documentation',
reportDir: 'build/community/html',
reportFiles: 'index.html',
keepAll: true,
alwaysLinkToLastBuild: true,
allowMissing: false
])
publishHTML([
reportName: 'Enterprise Documentation',
reportDir: 'build/enterprise/html',
reportFiles: 'index.html',
keepAll: true,
alwaysLinkToLastBuild: true,
allowMissing: false
])
}
}
}
post {
success {
echo 'Documentation previews generated and archived successfully.'
}
failure {
echo 'Failed to generate documentation previews.'
}
}
}