-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
67 lines (44 loc) · 2.07 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
node {
// Only keep one build
properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', numToKeepStr: '5']]])
stage('Compile Java library') {
cleanWs()
checkout scm
sh 'git submodule update --init'
//clear all
withMaven(mavenLocalRepo: '.repository', mavenSettingsFilePath: "${env.MVN_SETTINGS_PATH}") {
// Run the maven build
sh "mvn clean -f shmfmi-server/pom.xml"
}
//compile the java library
withMaven(mavenLocalRepo: '.repository', mavenSettingsFilePath: "${env.MVN_SETTINGS_PATH}") {
sh "./xcompile.sh"
sh "cd shmfmi-server && cp ../third_party/protobuf/builds/linux-x64/release/bin/protoc ."
// Run the maven build
sh "mvn install -f shmfmi-server/pom.xml"
step([$class: 'ArtifactArchiver', artifacts: '**/target/*.jar', fingerprint: true])
step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml, **/gtestresults.xml'])
step([$class: 'JacocoPublisher'])
step([$class: 'TasksPublisher', canComputeNew: false, defaultEncoding: '', excludePattern: '', healthy: '', high: 'FIXME', ignoreCase: true, low: '', normal: 'TODO', pattern: '', unHealthy: ''])
}
}
stage('Deploy') {
if (env.BRANCH_NAME == 'development' || env.BRANCH_NAME == 'master') {
def server = Artifactory.server "-844406945@1404457436085"
def buildInfo = Artifactory.newBuildInfo()
buildInfo.env.capture = true
def rtMaven = Artifactory.newMavenBuild()
rtMaven.tool = "Maven 3.1.1" // Tool name from Jenkins configuration
rtMaven.opts = "-Xmx1024m -XX:MaxPermSize=256M"
rtMaven.deployer releaseRepo:'into-cps', snapshotRepo:'into-cps', server: server
rtMaven.run pom: 'shmfmi-server/pom.xml', goals: 'install -P!protoc', buildInfo: buildInfo
//get rid of old snapshots only keep then for a short amount of time
//buildInfo.retention maxBuilds: 5, maxDays: 7, deleteBuildArtifacts: true
// Publish build info.
server.publishBuildInfo buildInfo
}
}
stage('Build Overture-FMU') {
build job: 'overture-fmu/development', wait: false
}
}