forked from eclipse-corrosion/corrosion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
62 lines (62 loc) · 2.33 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
62
pipeline {
agent {
label "centos-8"
}
options {
buildDiscarder(logRotator(numToKeepStr:'10'))
timeout(time: 1, unit: 'HOURS')
}
environment {
PATH = "$HOME/.local/bin:$HOME/.cargo/bin/:$PATH"
USER = "jenkins"
}
tools {
jdk 'openjdk-jdk11-latest'
}
stages {
stage('Prepare') {
steps {
sh 'org.eclipse.corrosion/scripts/rustup-init.sh -y'
sh 'rustup install stable-x86_64-unknown-linux-gnu'
sh 'rustup default stable-x86_64-unknown-linux-gnu'
sh 'mkdir -p ~/.local/bin && curl -L https://github.com/rust-analyzer/rust-analyzer/releases/latest/download/rust-analyzer-linux -o ~/.local/bin/rust-analyzer && chmod +x ~/.local/bin/rust-analyzer'
sh 'echo $PATH'
}
}
stage('Build') {
steps {
sh 'cargo --version'
sh 'rustup show'
sh 'rust-gdb --version'
wrap([$class: 'Xvnc', useXauthority: true]) {
sh './mvnw -Dmaven.repo.local=$WORKSPACE/.m2 clean verify -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true -Dtycho.showEclipseLog=true -PpackAndSign -Dsurefire.timeout=1800'
}
}
post {
always {
junit '*/target/surefire-reports/TEST-*.xml'
archiveArtifacts artifacts: '*/target/work/data/.metadata/.log'
}
}
}
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...)
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh '''
ssh genie.corrosion@projects-storage.eclipse.org rm -rf /home/data/httpd/download.eclipse.org/corrosion/snapshots
ssh genie.corrosion@projects-storage.eclipse.org mkdir -p /home/data/httpd/download.eclipse.org/corrosion/snapshots
scp -r repository/target/repository/* genie.corrosion@projects-storage.eclipse.org:/home/data/httpd/download.eclipse.org/corrosion/snapshots
ssh genie.corrosion@projects-storage.eclipse.org mkdir -p /home/data/httpd/download.eclipse.org/corrosion/snapshots/products
scp -r repository/target/products/*.tar.gz genie.corrosion@projects-storage.eclipse.org:/home/data/httpd/download.eclipse.org/corrosion/snapshots/products
scp -r repository/target/products/*.zip genie.corrosion@projects-storage.eclipse.org:/home/data/httpd/download.eclipse.org/corrosion/snapshots/products
'''
}
}
}
}
}