-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjenkins_cucumber
70 lines (70 loc) · 2.41 KB
/
jenkins_cucumber
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
pipeline {
agent any
parameters {
choice(name: 'Headless', choices: ['true', 'false'], description: '')
choice(name: 'Browser', choices: ['remote-chrome', 'remote-firefox'], description: '')
string(name: 'ThreadCount', defaultValue: '1', description: '')
string(name: 'Retry', defaultValue: '1', description: '')
gitParameter name: 'BRANCH_TAG',
type: 'PT_BRANCH',
defaultValue: 'master',
selectedValue: 'DEFAULT',
quickFilterEnabled: true,
sortMode: 'DESCENDING_SMART',
tagFilter: '*',
branchFilter: 'origin/(.*)',
useRepository: '.*.git',
description: 'Select your branch'
}
stages {
stage('Checkout & Run Tests') {
steps {
sh "docker run --network dockerize-network muhammettopcu/dockerize-ruby-web:latest git checkout ${params.BRANCH_TAG} && parallel_cucumber -n ${params.ThreadCount.toInteger()} -o 'headless=${Headless} browser=${Browser} --retry ${params.Retry.toInteger()}'"
}
}
}
post {
always {
cucumber([
buildStatus: 'null',
customCssFiles: '',
customJsFiles: '',
failedFeaturesNumber: -1,
failedScenariosNumber: -1,
failedStepsNumber: -1,
fileIncludePattern: '**/*.json',
jsonReportDirectory: 'reports',
pendingStepsNumber: -1,
reportTitle: 'Cucumber Report',
skippedStepsNumber: -1,
sortingMethod: 'ALPHABETICAL',
undefinedStepsNumber: -1
])
cleanWs()
dir("${env.WORKSPACE}@tmp") {
deleteDir()
}
dir("${env.WORKSPACE}@script") {
deleteDir()
}
dir("${env.WORKSPACE}@script@tmp") {
deleteDir()
}
}
success{
script{
sh "echo successful"
}
}
failure{
script{
sh "echo failed"
}
}
aborted{
script{
sh "echo aborted"
}
}
}
}