Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Adds variant and release job type checks
Browse files Browse the repository at this point in the history
  • Loading branch information
perdasilva committed Sep 19, 2019
1 parent b675d16 commit 8d91a8f
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion cd/Jenkinsfile_release_job
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,30 @@ pipeline {
stage("Release Job") {
steps {
script {

// Add new job types here
def valid_job_types = [
"mxnet_lib/static",
"mxnet_lib/dynamic",
"python/pypi"
]

// Convert mxnet variants to a list
def mxnet_variants = params.MXNET_VARIANTS.split(',').inject([]) { list, item ->
def mxnet_variants = params.MXNET_VARIANTS.trim().split(',').inject([]) { list, item ->
list << item.trim()
}.findAll { item -> item.notEmpty() }

echo "size: ${mxnet_variants.size()}"

// Exit successfully if there are no variants to build
if (mxnet_variants.size() == 0) {
currentBuild.result = 'SUCCESS'
return
}

// Only execute from allowed release job types
if (! ("${params.RELEASE_JOB_TYPE}" in valid_job_types)) {
error "Unknown release job type ${params.RELEASE_JOB_TYPE}"
}

// Load script for the supplied job type
Expand Down

0 comments on commit 8d91a8f

Please sign in to comment.