forked from modelica/ModelicaSpecification
/
Jenkinsfile
99 lines (99 loc) · 2.4 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
pipeline {
agent none
options {
disableConcurrentBuilds()
}
stages {
stage('checks') {
agent {
docker {
image 'alpine:3.9'
label 'linux'
}
}
steps {
sh label: "Find files with trailing whitespace", script: '! grep -n "[ \t]$" *.tex chapters/*.tex'
}
}
stage('verify grammar') {
agent {
docker {
image 'modelicaspec/antlr:20190521'
label 'linux'
}
}
environment {
CLASSPATH = '/usr/share/java/antlr4.jar:/usr/share/java/antlr3.jar:.'
}
steps {
sh 'echo $CLASSPATH'
sh 'cd grammar && ./build.sh -tree'
sh 'cd grammar && java Main /usr/lib/MODELICAPATH'
}
}
stage('build') {
agent {
docker {
image 'modelicaspec/latexml:20191011'
label 'linux'
alwaysPull true
}
}
steps {
sh 'latexmk -pdf MLS.tex'
sh 'latexml MLS.tex --dest MLS.xml'
sh 'latexmlpost MLS.xml -format html -pmml --splitat=chapter --javascript=css/LatexML-maybeMathJax.js --navigationtoc=context --css=css/LaTeXML-navbar-left.css --dest MLS.html'
sh 'tar czf MLS.tar.gz *.html *.css media css/'
archiveArtifacts artifacts: 'MLS.tar.gz', fingerprint: true
archiveArtifacts artifacts: 'MLS.pdf', fingerprint: true
stash name: 'MLS', includes: '*.html,*.css,MLS.pdf,media/**,css/**,MLS.tar.gz'
}
}
stage('upload') {
when {
allOf {
not {
changeRequest()
}
anyOf {
buildingTag()
anyOf {
branch 'master'
}
}
}
beforeAgent true
}
agent {
label 'linux'
}
steps {
unstash name: 'MLS'
sh "test ! -z ${env.GIT_BRANCH}"
sshPublisher(publishers: [sshPublisherDesc(configName: 'ModelicaSpecification', transfers: [sshTransfer(remoteDirectory: "${env.GIT_BRANCH}", sourceFiles: '*.html,*.css,MLS.pdf,media/**,css/**')])])
}
}
stage('index') {
agent {
docker {
image 'modelicaspec/markdown:20190307'
label 'linux'
alwaysPull true
}
}
when {
allOf {
not {
changeRequest()
}
branch 'master'
}
beforeAgent true
}
steps {
sh 'python3 .CI/index.py'
sshPublisher(publishers: [sshPublisherDesc(configName: 'ModelicaSpecification', transfers: [sshTransfer(sourceFiles: 'index.html')])])
}
}
}
}