forked from eclipse-corrosion/corrosion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
61 lines (61 loc) · 1.76 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
61
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr:'10'))
}
environment {
PATH = "$HOME/.cargo/bin/:$PATH"
}
tools {
maven 'apache-maven-latest'
jdk 'jdk1.8.0-latest'
}
stages {
stage('Prepare') {
steps {
git url: 'https://github.com/eclipse/corrosion.git'
cleanWs()
checkout scm
sh 'echo $PATH'
}
}
stage('Build') {
steps {
sh 'cargo --version'
sh 'rustup show'
wrap([$class: 'Xvnc', useXauthority: true]) {
sh 'mvn -Dmaven.repo.local=$WORKSPACE/.m2 clean verify -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true'
}
}
post {
always {
junit '*/target/surefire-reports/TEST-*.xml'
archiveArtifacts artifacts: '*/target/work/data/.metadata/.log'
}
}
}
stage('SonarQube analysis') {
when {
branch 'master'
}
steps {
withSonarQubeEnv('Eclipse Sonar') {
sh 'mvn -Dmaven.repo.local=$WORKSPACE/.m2 org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.jdbc.url=$SONAR_JDBC_URL -Dsonar.jdbc.username=$SONAR_JDBC_USERNAME -Dsonar.jdbc.password=$SONAR_JDBC_PASSWORD'
}
}
}
stage('Deploy') {
when {
branch 'master'
// TODO deploy all branch from Eclipse.org Git repo
}
steps {
// TODO compute the target URL (snapshots) according to branch name (0.5-snapshots...)
sh 'rm -rf /home/data/httpd/download.eclipse.org/corrosion/snapshots'
sh 'mkdir -p /home/data/httpd/download.eclipse.org/corrosion/snapshots'
sh 'cp -r repository/target/repository/* /home/data/httpd/download.eclipse.org/corrosion/snapshots'
sh 'cp repository/target/repository-*-SNAPSHOT.zip /home/data/httpd/download.eclipse.org/corrosion/snapshots/repository.zip'
}
}
}
}