-
Notifications
You must be signed in to change notification settings - Fork 48
/
Jenkinsfile
60 lines (58 loc) · 2.27 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
pipeline {
options {
timeout(time: 240, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr:'20'))
disableConcurrentBuilds(abortPrevious: true)
}
agent {
label "centos-7"
}
tools {
maven 'apache-maven-latest'
jdk 'openjdk-jdk17-latest'
}
stages {
stage('Build') {
steps {
withCredentials([file(credentialsId: 'SonarCloud token for gef', variable: 'SONARCLOUD_TOKEN')]) {
withSonarQubeEnv('sonar server', envOnly:false){
wrap([$class: 'Xvnc', takeScreenshot: false, useXauthority: true]) {
sh '''
export GDK_BACKEND=x11
mvn clean verify -Dmaven.repo.local=$WORKSPACE/.m2/repository \
-DapiBaselineTargetDirectory=${WORKSPACE} \
-Dgpg.passphrase="${KEYRING_PASSPHRASE}" \
-Dproject.build.sourceEncoding=UTF-8 \
-Peclipse-sign \
-B sonar:sonar -Dsonar.projectKey=gef-classic -Dsonar.organization=eclipse -Dsonar.host.url=${SONAR_HOST_URL} -Dsonar.login=${SONARCLOUD_TOKEN}
'''
}
}
}
}
post {
always {
archiveArtifacts artifacts: '.*log,org.eclipse.gef.repository/target/repository/*', allowEmptyArchive: true
junit(
allowEmptyResults: true,
testResults: '**/target/surefire-reports/*.xml'
)
}
failure {
mail bcc: '', body: "<b>GEF Classic: ${env.JOB_NAME} <br>Build Number: ${env.BUILD_NUMBER} <br> URL de build: ${env.BUILD_URL}", cc: '', charset: 'UTF-8', from: '', mimeType: 'text/html', replyTo: '', subject: "ERROR CI: GEF Classic -> ${env.JOB_NAME}", to: "alois.zoitl@gmx.at";
}
}
}
stage('Deploy') {
steps {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh '''
ssh -o BatchMode=yes genie.gef@projects-storage.eclipse.org rm -rf /home/data/httpd/download.eclipse.org/tools/gef/classic/latest
ssh -o BatchMode=yes genie.gef@projects-storage.eclipse.org mkdir -p /home/data/httpd/download.eclipse.org/tools/gef/classic/latest
scp -o BatchMode=yes -r org.eclipse.gef.repository/target/repository/* genie.gef@projects-storage.eclipse.org:/home/data/httpd/download.eclipse.org/tools/gef/classic/latest
'''
}
}
}
}
}