-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathJenkinsfile
More file actions
63 lines (62 loc) · 2.04 KB
/
Jenkinsfile
File metadata and controls
63 lines (62 loc) · 2.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
56
57
58
59
60
61
62
63
pipeline {
agent {
node 'docker'
}
parameters {
string(name: 'BRANCH', defaultValue: 'master')
string(name: 'IMAGE_BUILD_NUMBER')
booleanParam(name: 'FETCH_IMAGE', defaultValue: false)
text(name: 'PYTEST_ARGS', defaultValue: """-sv \\
tests/integration_tests/tests/agentless_tests \\
tests/integration_tests/tests/agent_tests""")
}
stages {
stage('Fetch the docker image'){
when {
expression { return params.FETCH_IMAGE }
}
steps {
sh '''
docker rmi -f cloudify-manager-aio:latest
'''
copyArtifacts(
projectName: '/dir_manager/build_docker_image_pipeline',
selector: params.IMAGE_BUILD_NUMBER ? specific(params.IMAGE_BUILD_NUMBER) : lastSuccessful()
)
sh '''
docker load -i cloudify*.tar
'''
}
}
stage('install the inte-tests package') {
steps {
sh '''
virtualenv venv
venv/bin/pip install 'https://github.com/cloudify-cosmo/cloudify-common/archive/master.zip#egg=cloudify-common[dispatcher]'
venv/bin/pip install https://github.com/cloudify-cosmo/cloudify-cli/archive/master.zip
venv/bin/pip install rest-service/
venv/bin/pip install tests/
'''
}
}
stage('run tests'){
steps {
sh """
export CI=no-color-logs
source venv/bin/activate
venv/bin/pytest \
${params.PYTEST_ARGS} \
--junitxml=test-results.xml
"""
}
post {
always {
junit 'test-results.xml'
}
cleanup {
cleanWs()
}
}
}
}
}