forked from finos/datahub
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
63 lines (63 loc) · 1.31 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
pipeline {
agent { label 'python36' }
options { timeout(time: 20, unit: 'MINUTES') }
stages {
stage('Initialise') {
steps {
stepInitialise()
stepPythonConfigure()
}
}
stage('Install Dependencies') {
steps {
sh """
python -m venv .env
source ./.env/bin/activate
python -m pip install -r requirements.txt
python -m pip install pytest pytest-cov coverage
"""
}
}
stage('Generate Documents') {
steps {
sh """
source ./.env/bin/activate
pip list
pydocmd build
"""
}
}
stage('Unit Tests') {
steps {
sh """
source ./.env/bin/activate
python -m pytest --cov-report xml --cov=. --junitxml=test_results.xml ./tests
"""
}
}
stage('Verify Local Install') {
steps {
sh """
source ./.env/bin/activate
python -m pip install ./
"""
}
}
stage('Sonar Analysis') {
steps {
stepPythonSonarAnalysis()
}
}
stage('Publish Package') {
when { expression { return env.LS_GIT_BRANCH ==~ "release.*" } }
steps {
stepPythonPackagePublish()
}
}
}
post {
always {
stepFinalise()
}
}
}