-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathJenkinsfile
94 lines (91 loc) · 2.86 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
pipeline {
options {
disableConcurrentBuilds()
}
agent any
tools {
maven 'maven-3.6.0'
jdk 'jdk8'
}
triggers {
// timer trigger for "nightly build" on master branch
cron( env.BRANCH_NAME.equals('master') ? 'H H(0-3) * * 1-5' : '')
}
environment {
STAGING_DIR = "/scratch/artifacts/imagetool"
}
stages {
stage ('Environment') {
steps {
sh '''
echo "PATH = ${PATH}"
echo "M2_HOME = ${M2_HOME}"
mvn --version
'''
}
}
stage ('Build') {
steps {
sh 'mvn -B -DskipTests -DskipITs clean install'
}
}
stage ('Test') {
when {
not {
changelog '\\[skip-ci\\]'
}
}
steps {
sh 'mvn test'
}
post {
always {
junit 'imagetool/target/surefire-reports/*.xml'
}
}
}
stage ('SystemTest Gate') {
when {
allOf {
changeRequest target: 'master'
not {
changelog '\\[skip-ci\\]'
}
}
}
steps {
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'otn-cred', passwordVariable: 'ORACLE_SUPPORT_PASSWORD', usernameVariable: 'ORACLE_SUPPORT_USERNAME']]) {
sh 'mvn verify -Dtest.staging.dir=${STAGING_DIR} -Dtest.groups=gate'
}
}
post {
always {
junit 'tests/target/failsafe-reports/*.xml'
}
}
}
stage ('SystemTest Full') {
when {
anyOf {
triggeredBy 'TimerTrigger'
tag "release-*"
}
}
steps {
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'otn-cred', passwordVariable: 'ORACLE_SUPPORT_PASSWORD', usernameVariable: 'ORACLE_SUPPORT_USERNAME']]) {
sh 'mvn verify -Dtest.staging.dir=${STAGING_DIR} -Dtest.groups=gate,nightly'
}
}
post {
always {
junit 'tests/target/failsafe-reports/*.xml'
}
failure {
mail to: "${env.WIT_BUILD_NOTIFICATION_EMAIL_TO}", from: 'noreply@oracle.com',
subject: "WebLogic Image Tool: ${env.JOB_NAME} - Failed",
body: "Job Failed - \"${env.JOB_NAME}\" build: ${env.BUILD_NUMBER}\n\nView the log at:\n ${env.BUILD_URL}\n"
}
}
}
}
}