-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
54 lines (47 loc) · 1.64 KB
/
Jenkinsfile
File metadata and controls
54 lines (47 loc) · 1.64 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
#!/usr/bin/env groovy
pipeline {
// Run everything on an existing agent configured with a label 'docker-agent'.
agent {
node {
label 'docker-agent'
}
}
stages {
stage('Bild restful-booker') {
steps {
// Install pip
sh 'curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py'
sh 'python get-pip.py'
// Install docker-compose
sh 'pip install docker-compose'
// Clone restful-booker repo
sh 'git clone https://github.com/mwinteringham/restful-booker.git'
// Start resrful-booker container
sh 'cd restful-booker && docker-compose build'
sh 'cd restful-booker && docker-compose up -d'
}
}
stage('Test') {
steps {
// Run the tests container
sh 'docker-compose build'
sh 'docker-compose up'
// Copy allure results to Jenkins host so the report can be generated
sh 'docker cp restful_booker_test_container:/home/python_API_testing/allure-results "${WORKSPACE}/allure-results"'
}
}
stage('Report') {
steps {
script {
allure([
includeProperties: false,
jdk: '',
properties: [],
reportBuildPolicy: 'ALWAYS',
results: [[path: 'target/allure-results']]
])
}
}
}
}
}