This repository has been archived by the owner on Apr 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
cdt-verify-code-cleanliness-pipeline.Jenkinsfile
66 lines (66 loc) · 2.73 KB
/
cdt-verify-code-cleanliness-pipeline.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
pipeline {
agent {
kubernetes {
yamlFile 'jenkins/pod-templates/cdt-full-pod-plus-eclipse-install.yaml'
}
}
options {
timestamps()
}
stages {
stage('Git Clone') {
steps {
container('cdt') {
timeout(activity: true, time: 20) {
/* Running the git fetch command manually is a workaround. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=560283#c16 */
sh 'git config remote.origin.url https://git.eclipse.org/r/cdt/org.eclipse.cdt.git'
/* Workaround for Bug 568904 */
sh 'git config protocol.version 1'
sh 'git fetch --no-tags --force --progress -- https://git.eclipse.org/r/cdt/org.eclipse.cdt.git +refs/heads/*:refs/remotes/origin/*'
}
/* Unlike other veify jobs, this one does baseline-compare-and-replace, which means it needs full depth on git clone */
checkout([$class: 'GitSCM', branches: [[name: '**']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CheckoutOption', timeout: 20], [$class: 'BuildChooserSetting', buildChooser: [$class: 'GerritTriggerBuildChooser']], [$class: 'CloneOption', honorRefspec: true, noTags: true, reference: '', timeout: 20]], submoduleCfg: [], userRemoteConfigs: [[refspec: '$GERRIT_REFSPEC', url: 'https://git.eclipse.org/r/cdt/org.eclipse.cdt.git']]])
}
}
}
stage('Code Formatting Checks for CDT version < 10.0') {
// CDT version < 10 uses Java 8
when {
expression { env.GERRIT_BRANCH ==~ /cdt_9.*/ }
}
steps {
container('cdt') {
timeout(activity: true, time: 30) {
withEnv(['MAVEN_OPTS=-XX:MaxRAMPercentage=60.0']) {
sh 'JAVA_HOME=$JAVA8_HOME PATH=$JAVA_HOME/bin:$PATH \
MVN="/usr/share/maven/bin/mvn -Dmaven.repo.local=/home/jenkins/.m2/repository \
--settings /home/jenkins/.m2/settings.xml" ./releng/scripts/check_code_cleanliness.sh'
}
}
}
}
}
stage('Code Formatting Checks for CDT version >= 10.0') {
when {
expression { env.GERRIT_BRANCH ==~ /(master|cdt_10.*)/ }
}
steps {
container('cdt') {
timeout(activity: true, time: 30) {
withEnv(['MAVEN_OPTS=-XX:MaxRAMPercentage=60.0']) {
sh 'MVN="/usr/share/maven/bin/mvn -Dmaven.repo.local=/home/jenkins/.m2/repository \
--settings /home/jenkins/.m2/settings.xml" ./releng/scripts/check_code_cleanliness.sh'
}
}
}
}
}
}
post {
always {
container('cdt') {
archiveArtifacts allowEmptyArchive: true, artifacts: '*.log,native/org.eclipse.cdt.native.serial/**,core/org.eclipse.cdt.core.*/**'
}
}
}
}