-
Notifications
You must be signed in to change notification settings - Fork 6
/
Jenkinsfile
66 lines (65 loc) · 2.11 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
63
64
65
66
// Pipeline using declarative syntax
// you can fall down to script syntax using the script { } command
pipeline {
agent any
options {
buildDiscarder( logRotator(numToKeepStr:'60', artifactNumToKeepStr: '1'))
}
tools {
maven 'apache-maven-latest'
jdk 'open-jdk-11'
}
//
stages {
stage('Build and verify') {
steps {
wrap([$class: 'Xvnc', takeScreenshot: false, useXauthority: true]) {
sh 'printenv'
sh "mvn --fail-at-end clean verify --errors --show-version"
}
}
post {
success {
junit 'tests/**/target/surefire-reports/TEST-*.xml'
}
}
}
stage("Archive in Jenkins") {
steps {
echo "archive artifact"
archiveArtifacts 'releng/org.eclipse.emf.ecoretools.ale.updatesite/target/repository/**, **/screenshots/**'
}
}
stage("Deploy") {
when { buildingTag()}
steps{
withAnt(installation: 'Ant_1.8.4') {
sh "ant -Dkey.file=/builds/.ssh/id_rsa -f releng/promotion_build.xml upload"
}
}
}
}
post {
fixed { // back to normal
emailext subject: 'Build $BUILD_STATUS $PROJECT_NAME #$BUILD_NUMBER!',
body: '''Check console output at $BUILD_URL to view the results.''',
recipientProviders: [[$class: 'CulpritsRecipientProvider'],[$class: 'RequesterRecipientProvider']],
to: '[email protected]'
}
// changed { }
unstable {
echo 'Unstable'
emailext subject: 'Build $BUILD_STATUS $PROJECT_NAME #$BUILD_NUMBER!',
body: '''Check console output at $BUILD_URL to view the results.''',
recipientProviders: [[$class: 'CulpritsRecipientProvider'],[$class: 'RequesterRecipientProvider']],
to: '[email protected]'
}
failure {
echo 'Failure'
emailext subject: 'Build $BUILD_STATUS $PROJECT_NAME #$BUILD_NUMBER!',
body: '''Check console output at $BUILD_URL to view the results.''',
recipientProviders: [[$class: 'CulpritsRecipientProvider'],[$class: 'RequesterRecipientProvider']],
to: '[email protected]'
}
}
}