forked from eclipse/n4js
/
Jenkinsfile.new
84 lines (78 loc) · 2.81 KB
/
Jenkinsfile.new
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
/*
* Copyright (c) 2017 NumberFour AG.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* NumberFour AG - Initial API and implementation
*/
pipeline {
agent {
dockerfile {
dir 'docker-build/'
// Reuse repository.volume container if one exists, to speed up subsequent builds.
args '-v n4js-m2-repository:/usr/share/maven/ref/repository/'
additionalBuildArgs '--build-arg MAVEN_CENTRAL_URL=' + env.MAVEN_CENTRAL_URL
label 'mesos-xlarge'
}
}
options {
ansiColor('xterm')
buildDiscarder(
logRotator(
numToKeepStr: '15',
artifactDaysToKeepStr: '30',
artifactNumToKeepStr: '15',
daysToKeepStr: '30'))
disableConcurrentBuilds()
timeout(time: 5, unit: 'HOURS')
timestamps()
}
environment {
MAVEN_OPTS = '-XX:+UseConcMarkSweepGC ' +
'-XX:+UnlockExperimentalVMOptions ' +
'-XX:+UseCGroupMemoryLimitForHeap ' +
'-XX:MaxRAMFraction=2 ' +
'-XshowSettings:vm '
}
stages {
stage('fs browse') {
steps {
script {
sh """\
pwd
git status
ls -la
"""
}
}
}
stage('build') {
steps {
sshagent(['github-com-ssh-key']) {
script {
def xvfb = 'xvfb-run -a --server-args="-screen 0 1024x768x24" '
def options = '-Dmaven.test.failure.ignore -e -DWORKSPACE=' + env.WORKSPACE
def profiles = [
'buildProduct',
'execute-plugin-tests',
'execute-plugin-ui-tests'
].join(',')
sh "export SWT_GTK3=0; ${xvfb} mvn --batch-mode --update-snapshots clean verify -P${profiles} ${options}"
}
}
}
}
}
post {
always {
archiveArtifacts allowEmptyArchive: false, artifacts: '**/builds/**/target/products/*.zip'
archiveArtifacts allowEmptyArchive: false, artifacts: '**/tools/**/target/n4jsc.jar'
archiveArtifacts allowEmptyArchive: true, artifacts: '**/logs/*.log'
junit '**/surefire-reports/**/*.xml'
deleteDir()
}
}
}