forked from GateNLP/gateplugin-Python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
62 lines (62 loc) · 2.35 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
pipeline {
agent any
triggers {
upstream(upstreamProjects: "gate-top", threshold: hudson.model.Result.SUCCESS)
}
tools {
maven 'Maven Current'
jdk 'JDK1.8'
}
options {
disableConcurrentBuilds()
}
stages {
stage ('Build') {
steps {
sh """
__condasetup="\$(/home/johann/software/miniconda3/bin/conda 'shell.bash' 'hook' 2> /dev/null)"
eval "\$__condasetup"
python --version
envfile=\$WORKSPACE/tmpenv
rm -rf \$envfile
python -m venv \$envfile
export PATH=\$envfile/bin:\$PATH
pip install -r \$WORKSPACE/python-requirements.txt
mvn -e clean install
"""
}
post {
always {
junit 'target/surefire-reports/**/*.xml'
jacoco exclusionPattern: '**/gate/gui/**,**/gate/resources/**'
warnings canRunOnFailed: true, canResolveRelativePaths: false, consoleParsers: [[parserName: 'Java Compiler (javac)']], defaultEncoding: 'UTF-8', excludePattern: '**/test/**', failedNewAll: '0', unstableNewAll: '0', useStableBuildAsReference: true
}
}
}
stage('Document') {
when{
expression { currentBuild.currentResult != "FAILED" && currentBuild.changeSets != null && currentBuild.changeSets.size() > 0 }
}
steps {
sh 'mvn -e -DskipTests site'
}
post {
always {
findbugs canRunOnFailed: true, excludePattern: '**/gate/resources/**', failedNewAll: '0', pattern: '**/findbugsXml.xml', unstableNewAll: '0', useStableBuildAsReference: true
}
success {
step([$class: 'JavadocArchiver', javadocDir: 'target/site/apidocs', keepAll: false])
}
}
}
stage('Deploy') {
when{
branch 'main'
expression { currentBuild.currentResult == "SUCCESS" && currentBuild.changeSets != null && currentBuild.changeSets.size() > 0 }
}
steps {
sh 'mvn -e -Dmaven.test.skip=true source:jar javadoc:jar deploy'
}
}
}
}