forked from eclipse-n4js/n4js
-
Notifications
You must be signed in to change notification settings - Fork 1
/
inhouse-ci.jenkinsfile
90 lines (83 loc) · 3.18 KB
/
inhouse-ci.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
/*
* 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.
// Bind to host's docker sock to use host's docker daemon
args '--group-add 994 --network=host -v n4js-m2-repository:/usr/share/maven/ref/repository/ -v /var/run/docker.sock:/var/run/docker.sock'
additionalBuildArgs '--build-arg MAVEN_CENTRAL_URL=' + env.MAVEN_CENTRAL_URL
label 'm5xlarge'
}
}
options {
ansiColor('xterm')
buildDiscarder(
logRotator(
numToKeepStr: '15',
artifactDaysToKeepStr: '30',
artifactNumToKeepStr: '15',
daysToKeepStr: '30'))
timeout(time: 5, unit: 'HOURS')
timestamps()
}
environment {
MAVEN_OPTS = '-XX:+UnlockExperimentalVMOptions ' +
'-XX:+UseCGroupMemoryLimitForHeap ' +
'-XX:MaxRAMFraction=2 ' +
'-XshowSettings:vm '
}
triggers {
pollSCM('H/5 * * * *') // every 5 minutes
}
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.redirectTestOutputToFile=true -Dmaven.test.failure.ignore -e -DWORKSPACE=' + env.WORKSPACE
def profiles = [
'buildProduct',
'execute-plugin-tests',
'execute-plugin-ui-tests',
'execute-hlc-integration-tests'
].join(',')
sh "export SWT_GTK3=0; ${xvfb} mvn --batch-mode --quiet --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'
archiveArtifacts allowEmptyArchive: true, artifacts: '**/tests/**/target/**/*-output.txt'
junit '**/surefire-reports/**/*.xml'
junit '**/failsafe-reports/**/*.xml'
deleteDir()
}
}
}