Skip to content

Commit

Permalink
chore(npm-publish): trying to fix issue getting size of array
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanstith15 committed Oct 9, 2024
1 parent cc37571 commit 5076106
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ webappPipeline {
withCredentials([
string(credentialsId: constants.credentials.npm, variable: 'NPM_TOKEN')
]) {
def failures = []
def failures = new ArrayList<String>()

def componentStatCode = sh(script: "npm publish --workspace=packages/genesys-spark-components ${publishOptions}",
label: 'Publish Components',
returnStatus: true
)

if(componentStatCode > 0) {
failures.push('Publish Components')
failures.add('Publish Components')
}

def chartStatCode = sh(script: "npm publish --workspace=packages/genesys-spark-chart-components ${publishOptions}",
Expand All @@ -134,7 +134,7 @@ webappPipeline {
)

if(chartStatCode > 0) {
failures.push('Publish Chart Components')
failures.add('Publish Chart Components')
}

def mainPackageStatCode = sh(script: "npm publish --workspace=packages/genesys-spark ${publishOptions}",
Expand All @@ -143,7 +143,7 @@ webappPipeline {
)

if(mainPackageStatCode > 0) {
failures.push('Publish Main Package')
failures.add('Publish Main Package')
}

sh(script: '''
Expand All @@ -160,7 +160,7 @@ webappPipeline {
)

if(reactStatCode > 0) {
failures.push('Publish React Components')
failures.add('Publish React Components')
}

def chartReactStatCode = sh(script: "npm publish --workspace=packages/genesys-spark-chart-components-react ${publishOptions}",
Expand All @@ -169,11 +169,11 @@ webappPipeline {
)

if(chartReactStatCode > 0) {
failures.push('Publish Chart React Components')
failures.add('Publish Chart React Components')
}

def notification = new com.genesys.jenkins.Notifications()
if (failures.length) {
if (failures.size()) {
notification.sendEmailViaMailchomp("Spark NPM Publish failures", mailer, "These packages failed to publish to NPM:\n" + failures.join('\n'))
}
}
Expand Down

0 comments on commit 5076106

Please sign in to comment.