forked from JModelica/JModelica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile-linux
48 lines (43 loc) · 2.04 KB
/
Jenkinsfile-linux
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
// This loads the Jenkins pipeline library found in the ci folder.
def url = scm.getLocations()[0].remote
library identifier: 'JModelica@ci', retriever: modernSCM([$class: 'SubversionSCMSource', remoteBase: url, credentialsId: ''])
// Extract branch info from url variable (this assumes that this Jenkinsfile
// has been checked out directly by Jenkins as part of pipeline build).
(JM_SVN_PATH, JM_SVN_TYPE, JM_SVN_NAME) = extractBranchInfo("https://svn.jmodelica.org", url)
// Temporarily cannot upload to server
boolean SHOULD_UPLOAD_INSTALL = false // JM_SVN_PATH.equals("trunk")
// Set build name:
currentBuild.displayName += " (" + (env.TRIGGER_CAUSE == null ? "MANUAL" : env.TRIGGER_CAUSE) + ")"
// Set discard policy
properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '5', daysToKeepStr: '', numToKeepStr: ''))])
node ("linux") {
stage("Checkout JModelica.org") {
checkout([
$class: 'SubversionSCM',
locations: [
[local: 'JModelica', remote: "https://svn.jmodelica.org/${JM_SVN_PATH}"],
],
workspaceUpdater: [$class: 'UpdateWithCleanUpdater'],
quietOperation: true,
])
}
stage("Build, test and archive") {
sh """
echo "exporting 1"
export USER=jenkins
echo "exporting 2"
export SCRIPT_PATH="${P510_PATH}/Jenkins/scripts"
echo "exporting 3"
export IPOPT_HOME="/home/jenkins/Ipopt-3.10.2/install"
echo "exporting 4"
export TEST_TAGS="-a stddist_base -a stddist_full -a fmi -a ipopt -a assimulo -a casadi_base -a casadi_full -a slow -a noncompliantfmi "
echo "chmod 5"
chmod u+x "${SCRIPT_PATH}/jm-buildAndTest.sh"
echo "running jm-buildAndTest.sh"
"${SCRIPT_PATH}/jm-buildAndTest.sh"
echo "shellscript done"
"""
archive '*.tar.gz'
junit testResults: "results/*.xml, src/Compiler/OptimicaCompiler/doc/junit-reports/TEST-org.jmodelica.test.optimica.junitgenerated.*.xml", allowEmptyResults: true
}
}