-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
55 lines (53 loc) · 1.04 KB
/
Jenkinsfile
File metadata and controls
55 lines (53 loc) · 1.04 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
properties([
pipelineTriggers([
[$class: 'SCMTrigger', scmpoll_spec: '', quietPeriod: 15]
])
])
pipeline {
agent {
label 'Agent Jenkins'
}
stages {
stage('Checkout') {
steps {
script{
checkout scm
echo "Checked out to branch: ${env.BRANCH_NAME}"
}
}
}
stage('Maven tests') {
steps{
script{
try {
sh '''
pwd
'''
} catch (Exception e){
echo "Test failed, but continuing..."
currentBuild.result = 'UNSTABLE'
}
}
}
}
stage('Newman Test') {
steps {
sh '''
pwd
newman run materials/postman/Planetarium.postman_collection.json -e materials/postman/Planetarium.postman_environment.json --env-var url=localhost:8080 -r cli,json
'''
}
}
}
post {
always {
emailext(
subject: "Build Results: ${env.JOB_NAME} #${env.BUILD_NUMBER}",
body: "The build has finished. Please find the attached log file.",
attachLog: true,
attachmentsPattern: 'Planetarium/output.txt',
to: '$DEFAULT_RECIPIENTS'
)
}
}
}