forked from RedHatInsights/insights-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
115 lines (114 loc) · 3.08 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
@Library('fh-pipeline-library')_
pipeline {
agent none
stages {
stage('Trust') {
steps {
enforceTrustedApproval('RedHatInsights')
}
}
stage('Build and Test Insights Core') {
parallel {
stage('Build RHEL6') {
agent {
node {
label 'python26'
}
}
steps {
echo "Testing with Pytest..."
sh """
virtualenv .testenv
source .testenv/bin/activate
pip install /pip_packages/pip-9.0.3-py2.py3-none-any.whl
pip install -r /var/lib/jenkins/ci_requirements.txt -f /pip_packages
pip install -e .[testing] -f /pip_packages
pytest
"""
echo "Testing with Linter..."
sh """
virtualenv .lintenv
source .lintenv/bin/activate
pip install /pip_packages/pip-9.0.3-py2.py3-none-any.whl
pip install -r /var/lib/jenkins/ci_requirements.txt -f /pip_packages
pip install -e .[linting] -f /pip_packages
flake8
"""
}
}
stage('Build RHEL7 Python 2.7') {
agent {
node {
label 'python'
}
}
steps {
echo "Testing with Pytest..."
sh """
virtualenv .testenv
source .testenv/bin/activate
pip install -e .[testing]
pytest
"""
echo "Testing with Linter..."
sh """
virtualenv .lintenv
source .lintenv/bin/activate
pip install -e .[linting]
flake8
"""
}
}
stage('Build RHEL7 Python 3.6') {
agent {
node {
label 'python3'
}
}
steps {
echo "Testing with Pytest..."
sh """
/bin/python3 -m venv .testenv
source .testenv/bin/activate
pip install -e .[testing]
pytest
"""
echo "Testing with Linter..."
sh """
/bin/python3 -m venv .lintenv
source .lintenv/bin/activate
pip install -e .[linting]
flake8
"""
}
}
}
}
stage('Nofity Github - Code Check Passed') {
steps {
githubNotify description: 'Code Checks Passed', status: 'SUCCESS'
}
}
stage('Test Docs') {
agent {
node {
label 'python3'
}
}
steps {
echo "Building Docs..."
sh """
/bin/python3 -m venv .docenv
source .docenv/bin/activate
pip install -e .[docs]
sphinx-build -W -b html -qa -E docs docs/_build/html
"""
}
}
stage('Nofity Github - Docs Check Passed') {
steps {
githubNotify description: 'Code Checks and Docs Generation Passed', status: 'SUCCESS'
}
}
}
}