@@ -275,25 +275,30 @@ def buildConda() {
275
275
return { params ->
276
276
stage(' Build Conda Packages' ) {
277
277
if (params. buildConda. toBoolean()) {
278
- dir(" py/build/conda" ) {
279
- def pythonVersions = [' 2.7' , ' 3.6' ]
280
- for (pyVersion in pythonVersions) {
281
- sh """
282
- . /envs/h2o_env_python3.6/bin/activate
283
-
284
- conda build h2o_pysparkling_${ params.spark} --output-folder "." --no-anaconda-upload --py ${ pyVersion}
285
-
286
- PACKAGE_PATH=\$ (conda build h2o_pysparkling_${ params.spark} --py ${ pyVersion} --output-folder "." --output | tail -1)
287
- CURRENT_PLATFORM=\$ (basename \$ (dirname \$ PACKAGE_PATH))
288
- mkdir -p ../../../dist/build/dist/py/conda/\$ CURRENT_PLATFORM
289
- cp \$ PACKAGE_PATH ../../../dist/build/dist/py/conda/\$ CURRENT_PLATFORM/
290
-
291
- conda convert \$ PACKAGE_PATH -p linux-32 -o ../../../dist/build/dist/py/conda/
292
- conda convert \$ PACKAGE_PATH -p linux-64 -o ../../../dist/build/dist/py/conda/
293
- conda convert \$ PACKAGE_PATH -p win-32 -o ../../../dist/build/dist/py/conda/
294
- conda convert \$ PACKAGE_PATH -p win-64 -o ../../../dist/build/dist/py/conda/
295
- conda convert \$ PACKAGE_PATH -p osx-64 -o ../../../dist/build/dist/py/conda/
296
- """
278
+ def packages = [
279
+ [path : " py/build/conda" , name : " h2o_pysparkling_${ params.spark} " ],
280
+ [path : " py-scoring/build/conda" , name : " h2o_pysparkling_scoring_${ params.spark} " ]]
281
+ for (packageDetails in packages) {
282
+ dir(packageDetails. path) {
283
+ def pythonVersions = [' 2.7' , ' 3.6' ]
284
+ for (pyVersion in pythonVersions) {
285
+ sh """
286
+ . /envs/h2o_env_python3.6/bin/activate
287
+
288
+ conda build ${ packageDetails.name} --output-folder "." --no-anaconda-upload --py ${ pyVersion}
289
+
290
+ PACKAGE_PATH=\$ (conda build ${ packageDetails.name} --py ${ pyVersion} --output-folder "." --output | tail -1)
291
+ CURRENT_PLATFORM=\$ (basename \$ (dirname \$ PACKAGE_PATH))
292
+ mkdir -p ../../../dist/build/dist/py/conda/\$ CURRENT_PLATFORM
293
+ cp \$ PACKAGE_PATH ../../../dist/build/dist/py/conda/\$ CURRENT_PLATFORM/
294
+
295
+ conda convert \$ PACKAGE_PATH -p linux-32 -o ../../../dist/build/dist/py/conda/
296
+ conda convert \$ PACKAGE_PATH -p linux-64 -o ../../../dist/build/dist/py/conda/
297
+ conda convert \$ PACKAGE_PATH -p win-32 -o ../../../dist/build/dist/py/conda/
298
+ conda convert \$ PACKAGE_PATH -p win-64 -o ../../../dist/build/dist/py/conda/
299
+ conda convert \$ PACKAGE_PATH -p osx-64 -o ../../../dist/build/dist/py/conda/
300
+ """
301
+ }
297
302
}
298
303
}
299
304
}
@@ -345,13 +350,15 @@ def publishToPipy() {
345
350
return { params ->
346
351
stage(' Publish to PiPy' ) {
347
352
if (params. publishToPiPy. toBoolean()) {
348
- dir(" py/build/pkg" ) {
349
- params. commons. withPipyCredentials {
350
- sh """
351
- . /envs/h2o_env_python3.6/bin/activate
352
- python setup.py sdist
353
- twine upload dist/* -u $PIPY_USERNAME -p $PIPY_PASSWORD
354
- """
353
+ for (projectName in [" py" , " py-scoring" ]) {
354
+ dir(" $projectName /build/pkg" ) {
355
+ params. commons. withPipyCredentials {
356
+ sh """
357
+ . /envs/h2o_env_python3.6/bin/activate
358
+ python setup.py sdist
359
+ twine upload dist/* -u $PIPY_USERNAME -p $PIPY_PASSWORD
360
+ """
361
+ }
355
362
}
356
363
}
357
364
}
@@ -367,10 +374,10 @@ def publishCondaArtifact(arch, pkgName) {
367
374
}
368
375
369
376
370
- def getCondaPkgName (params , pyVersion ) {
377
+ def getCondaPkgName (pyVersion , packageName ) {
371
378
return sh(returnStdout : true , script :
372
379
"""
373
- CONDA_PKG_CURRENT_ARCH_PATH=\$ (conda build h2o_pysparkling_ ${ params.spark } --py ${ pyVersion} --output-folder "." --output | tail -1)
380
+ CONDA_PKG_CURRENT_ARCH_PATH=\$ (conda build ${ packageName } --py ${ pyVersion} --output-folder "." --output | tail -1)
374
381
basename \$ CONDA_PKG_CURRENT_ARCH_PATH
375
382
""" ). trim()
376
383
}
@@ -379,13 +386,18 @@ def publishToConda() {
379
386
return { params ->
380
387
stage(' Publish to Conda' ) {
381
388
if (params. buildConda. toBoolean() && params. publishConda. toBoolean()) {
382
- dir(" py/build/conda" ) {
383
- params. commons. withCondaCredentials {
384
- def pythonVersions = [' 2.7' , ' 3.6' ]
385
- for (pyVersion in pythonVersions) {
386
- def pkgName = getCondaPkgName(params, pyVersion)
387
- for (arch in [' osx-64' , ' linux-32' , ' linux-64' , ' win-32' , ' win-64' ]) {
388
- publishCondaArtifact(arch, pkgName)
389
+ def packages = [
390
+ [path : " py/build/conda" , name : " h2o_pysparkling_${ params.spark} " ],
391
+ [path : " py-scoring/build/conda" , name : " h2o_pysparkling_scoring_${ params.spark} " ]]
392
+ for (packageDetails in packages) {
393
+ dir(packageDetails. path) {
394
+ params. commons. withCondaCredentials {
395
+ def pythonVersions = [' 2.7' , ' 3.6' ]
396
+ for (pyVersion in pythonVersions) {
397
+ def pkgName = getCondaPkgName(pyVersion, packageDetails. name)
398
+ for (arch in [' osx-64' , ' linux-32' , ' linux-64' , ' win-32' , ' win-64' ]) {
399
+ publishCondaArtifact(arch, pkgName)
400
+ }
389
401
}
390
402
}
391
403
}
0 commit comments