-
Notifications
You must be signed in to change notification settings - Fork 41
/
Jenkinsfile
114 lines (114 loc) · 3.63 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
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('build') {
agent {
docker {
image 'modelicaspec/latexml:20200804'
label 'linux'
alwaysPull true
}
}
environment {
HOME = '/tmp/jenkins'
}
steps {
sh 'mkdir -p /tmp/jenkins'
sh 'latexmk -pdf MLS.tex'
sh 'latexml --path=media MLS.tex --dest MLS.xml'
sh 'latexmlpost MLS.xml -format html -pmml --splitat=chapter --splitnaming=labelrelative --javascript=LaTeXML-maybeMathjax.js --navigationtoc=context --css=css/MLS.css --css=css/LaTeXML-navbar-left.css --dest MLS.html'
sh 'ln -s preface.html Chx1.html'
sh 'ln -s lexical-structure.html Ch2.html'
sh 'ln -s operators-and-expressions.html Ch3.html'
sh 'ln -s class-predefined-types-and-declarations.html Ch4.html'
sh 'ln -s scoping-name-lookup-and-flattening.html Ch5.html'
sh 'ln -s interface-or-type-relationships.html Ch6.html'
sh 'ln -s inheritance-modification-and-redeclaration.html Ch7.html'
sh 'ln -s equations.html Ch8.html'
sh 'ln -s connectors-and-connections.html Ch9.html'
sh 'ln -s arrays.html Ch10.html'
sh 'ln -s statements-and-algorithm-sections.html Ch11.html'
sh 'ln -s functions.html Ch12.html'
sh 'ln -s packages.html Ch13.html'
sh 'ln -s overloaded-operators.html Ch14.html'
sh 'ln -s stream-connectors.html Ch15.html'
sh 'ln -s synchronous-language-elements.html Ch16.html'
sh 'ln -s state-machines.html Ch17.html'
sh 'ln -s annotations.html Ch18.html'
sh 'ln -s unit-expressions.html Ch19.html'
sh 'ln -s the-modelica-standard-library.html Ch20.html'
sh 'ln -s glossary.html A1.html'
sh 'ln -s modelica-concrete-syntax.html A2.html'
sh 'ln -s modelica-dae-representation.html A3.html'
sh 'ln -s derivation-of-stream-equations.html A4.html'
sh 'ln -s modelica-revision-history.html A5.html'
sh 'ln -s literature.html A6.html'
sh script: '! (find . -type l -xtype l | egrep \'.*\')', label: 'Verify symbolic links work'
sh 'tar czf MLS.tar.gz *.html *.css *.js media/ css/'
archiveArtifacts artifacts: 'MLS.tar.gz', fingerprint: true
archiveArtifacts artifacts: 'MLS.pdf', fingerprint: true
stash name: 'MLS', includes: '*.html,*.css,*.js,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,*.js,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')])])
}
}
}
}