forked from eclipse-m2e/m2e-core
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile
More file actions
69 lines (69 loc) · 2.2 KB
/
Copy pathJenkinsfile
File metadata and controls
69 lines (69 loc) · 2.2 KB
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
pipeline {
options {
timeout(time: 45, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr:'10'))
disableConcurrentBuilds(abortPrevious: true)
}
agent {
label "centos-latest"
}
tools {
maven 'apache-maven-latest'
jdk 'openjdk-latest'
}
stages {
stage('get m2e-core-tests') {
steps {
sh 'git submodule update --init --recursive --remote'
}
}
stage('Build') {
steps {
sh 'mvn clean generate-sources -f m2e-maven-runtime/pom.xml -B -Dtycho.mode=maven -Pgenerate-osgi-metadata'
wrap([$class: 'Xvnc', useXauthority: true]) {
sh 'mvn clean verify -f pom.xml -B -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true -Peclipse-sign,its -Dtycho.surefire.timeout=7200'
}
}
post {
always {
archiveArtifacts artifacts: 'org.eclipse.m2e.repository/target/*.zip,\
*/target/work/data/.metadata/.log,\
m2e-core-tests/*/target/work/data/.metadata/.log,\
m2e-maven-runtime/target/*.properties'
archiveArtifacts (artifacts: '**/target/products/*.zip,**/target/products/*.tar.gz', onlyIfSuccessful: true)
junit '*/target/surefire-reports/TEST-*.xml,*/*/target/surefire-reports/TEST-*.xml'
}
}
}
stage('Deploy Snapshot') {
when {
branch 'master'
}
steps {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh '''
deployM2ERepository()
{
echo Deploy m2e repo to ${1}
ssh genie.m2e@projects-storage.eclipse.org "\
rm -rf ${1}/* && \
mkdir -p ${1}"
scp -r org.eclipse.m2e.repository/target/repository/* genie.m2e@projects-storage.eclipse.org:${1}
}
# Read M2E branding version
version=$(xmllint --xpath 'string(/feature/@version)' org.eclipse.m2e.sdk.feature/feature.xml)
if [[ $version =~ ([0-9]\\.[0-9]\\.[0-9])\\.qualifier ]] # backslash itself has to be escaped in Jenkinsfile
then
M2E_VERSION="${BASH_REMATCH[1]}"
else
echo Failed to read M2E_VERSION. Abort deployment.
exit 1
fi
deployM2ERepository /home/data/httpd/download.eclipse.org/technology/m2e/snapshots/${M2E_VERSION}
deployM2ERepository /home/data/httpd/download.eclipse.org/technology/m2e/snapshots/latest
'''
}
}
}
}
}