@@ -47,91 +47,88 @@ pipeline {
4747 sh " pyenv local 3.6.8"
4848 }
4949 }
50- stage (" Parallel Jobs" ) {
51- parallel {
52- stage (" Linting Check" ) {
53- steps {
54- script {
55- env. lint_result = " FAILURE"
56- }
57- bbcGithubNotify(context : " lint/flake8" , status : " PENDING" )
58- sh ' flake8'
59- script {
60- env. lint_result = " SUCCESS" // This will only run if the sh above succeeded
61- }
62- }
63- post {
64- always {
65- bbcGithubNotify(context : " lint/flake8" , status : env. lint_result)
66- }
67- }
50+ stage (" Clean" ) {
51+ steps {
52+ sh ' git clean -dfx'
53+ sh ' make clean'
54+ }
55+ }
56+ stage (" Linting Check" ) {
57+ steps {
58+ script {
59+ env. lint_result = " FAILURE"
6860 }
69- stage (" Build Docs" ) {
70- steps {
71- sh ' TOXDIR=/tmp/$(basename ${WORKSPACE})/tox-docs make docs'
72- }
73- }
74- stage (" Unit Tests" ) {
75- stages {
76- stage (" Python 2.7 Unit Tests" ) {
77- steps {
78- script {
79- env. py27_result = " FAILURE"
80- }
81- bbcGithubNotify(context : " tests/py27" , status : " PENDING" )
82- // Use a workdirectory in /tmp to avoid shebang length limitation
83- sh ' tox -e py27 --recreate --workdir /tmp/$(basename ${WORKSPACE})/tox-py27'
84- script {
85- env. py27_result = " SUCCESS" // This will only run if the sh above succeeded
86- }
87- }
88- post {
89- always {
90- bbcGithubNotify(context : " tests/py27" , status : env. py27_result)
91- }
92- }
93- }
94- stage (" Python 3 Unit Tests" ) {
95- steps {
96- script {
97- env. py3_result = " FAILURE"
98- }
99- bbcGithubNotify(context : " tests/py3" , status : " PENDING" )
100- // Use a workdirectory in /tmp to avoid shebang length limitation
101- sh ' tox -e py3 --recreate --workdir /tmp/$(basename ${WORKSPACE})/tox-py3'
102- script {
103- env. py3_result = " SUCCESS" // This will only run if the sh above succeeded
104- }
105- }
106- post {
107- always {
108- bbcGithubNotify(context : " tests/py3" , status : env. py3_result)
109- }
110- }
111- }
112- }
61+ bbcGithubNotify(context : " lint/flake8" , status : " PENDING" )
62+ sh ' make lint'
63+ script {
64+ env. lint_result = " SUCCESS" // This will only run if the sh above succeeded
11365 }
114- stage (" Debian Source Build" ) {
115- steps {
116- script {
117- env. debSourceBuild_result = " FAILURE"
118- }
119- bbcGithubNotify(context : " deb/sourceBuild" , status : " PENDING" )
66+ }
67+ post {
68+ always {
69+ bbcGithubNotify(context : " lint/flake8" , status : env. lint_result)
70+ }
71+ }
72+ }
73+ stage (" Type Check" ) {
74+ steps {
75+ script {
76+ env. mypy_result = " FAILURE"
77+ }
78+ bbcGithubNotify(context : " type/mypy" , status : " PENDING" )
79+ sh ' make mypy'
80+ script {
81+ env. mypy_result = " SUCCESS" // This will only run if the sh above succeeded
82+ }
83+ }
84+ post {
85+ always {
86+ bbcGithubNotify(context : " type/mypy" , status : env. mypy_result)
87+ }
88+ }
89+ }
90+ stage (" Build Docs" ) {
91+ steps {
92+ sh ' make docs'
93+ }
94+ }
95+ stage (" Python 3 Unit Tests" ) {
96+ steps {
97+ script {
98+ env. py3_result = " FAILURE"
99+ }
100+ bbcGithubNotify(context : " tests/py3" , status : " PENDING" )
101+ // Use a workdirectory in /tmp to avoid shebang length limitation
102+ sh ' make test'
103+ script {
104+ env. py3_result = " SUCCESS" // This will only run if the sh above succeeded
105+ }
106+ }
107+ post {
108+ always {
109+ bbcGithubNotify(context : " tests/py3" , status : env. py3_result)
110+ }
111+ }
112+ }
113+ stage (" Debian Source Build" ) {
114+ steps {
115+ script {
116+ env. debSourceBuild_result = " FAILURE"
117+ }
118+ bbcGithubNotify(context : " deb/sourceBuild" , status : " PENDING" )
120119
121- sh ' rm -rf deb_dist'
122- sh ' python ./setup.py sdist'
123- sh ' make dsc'
124- bbcPrepareDsc()
125- stash(name : " deb_dist" , includes : " deb_dist/*" )
126- script {
127- env. debSourceBuild_result = " SUCCESS" // This will only run if the steps above succeeded
128- }
129- }
130- post {
131- always {
132- bbcGithubNotify(context : " deb/sourceBuild" , status : env. debSourceBuild_result)
133- }
134- }
120+ sh ' rm -rf deb_dist'
121+ sh ' python ./setup.py sdist'
122+ sh ' make dsc'
123+ bbcPrepareDsc()
124+ stash(name : " deb_dist" , includes : " deb_dist/*" )
125+ script {
126+ env. debSourceBuild_result = " SUCCESS" // This will only run if the steps above succeeded
127+ }
128+ }
129+ post {
130+ always {
131+ bbcGithubNotify(context : " deb/sourceBuild" , status : env. debSourceBuild_result)
135132 }
136133 }
137134 }
@@ -159,14 +156,14 @@ pipeline {
159156 expression { return params. FORCE_DEBUPLOAD }
160157 expression { return params. FORCE_DOCSUPLOAD }
161158 expression {
162- bbcShouldUploadArtifacts(branches : [" master" ])
159+ bbcShouldUploadArtifacts(branches : [" master" , " dev " ])
163160 }
164161 }
165162 }
166- parallel {
163+ stages {
167164 stage (" Upload Docs" ) {
168165 when {
169- anyOf {
166+ anyOf {
170167 expression { return params. FORCE_DOCSUPLOAD }
171168 expression {
172169 bbcShouldUploadArtifacts(branches : [" master" ])
@@ -192,9 +189,8 @@ pipeline {
192189 }
193190 bbcGithubNotify(context : " pypi/upload" , status : " PENDING" )
194191 sh ' rm -rf dist/*'
195- bbcMakeGlobalWheel(" py27" )
196- bbcMakeGlobalWheel(" py3" )
197- bbcTwineUpload(toxenv : " py3" , pypi : true )
192+ bbcMakeGlobalWheel(" py36" )
193+ bbcTwineUpload(toxenv : " py36" , pypi : true )
198194 script {
199195 env. pypiUpload_result = " SUCCESS" // This will only run if the steps above succeeded
200196 }
@@ -205,6 +201,33 @@ pipeline {
205201 }
206202 }
207203 }
204+ stage (" Upload to Artifactory" ) {
205+ when {
206+ anyOf {
207+ expression { return params. FORCE_PYUPLOAD }
208+ expression {
209+ bbcShouldUploadArtifacts(branches : [" dev" ])
210+ }
211+ }
212+ }
213+ steps {
214+ script {
215+ env. artifactoryUpload_result = " FAILURE"
216+ }
217+ bbcGithubNotify(context : " artifactory/upload" , status : " PENDING" )
218+ sh ' rm -rf dist/*'
219+ bbcMakeGlobalWheel(" py36" )
220+ bbcTwineUpload(toxenv : " py36" , pypi : false )
221+ script {
222+ env. artifactoryUpload_result = " SUCCESS" // This will only run if the steps above succeeded
223+ }
224+ }
225+ post {
226+ always {
227+ bbcGithubNotify(context : " artifactory/upload" , status : env. artifactoryUpload_result)
228+ }
229+ }
230+ }
208231 stage (" Upload deb" ) {
209232 when {
210233 anyOf {
@@ -238,11 +261,11 @@ pipeline {
238261 }
239262 }
240263 }
241- }
242- }
243- post {
244- always {
245- bbcSlackNotify( channel : " #apmm-cloudfit " )
264+ post {
265+ always {
266+ bbcSlackNotify( channel : " #apmm-cloudfit " )
267+ }
268+ }
246269 }
247270 }
248271}
0 commit comments