Skip to content

Commit

Permalink
Changed finally
Browse files Browse the repository at this point in the history
  • Loading branch information
aaradhak committed Mar 14, 2024
1 parent ba325ed commit 1cc1685
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions jobs/bump-jenkins-plugins.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ node {

def pluginslist
def pluginsToUpdate = [:]
def haveChanges
def plugins_lockfile = "jenkins/controller/plugins.txt"

stage("Read plugins.txt") {
Expand Down Expand Up @@ -77,7 +76,6 @@ node {
pluginUrl = shwrapCapture("curl -Ls -I -f -o /dev/null -w '%{url_effective}' https://updates.jenkins.io/download/plugins/${pluginName}/latest/${pluginName}.hpi")
def latestVersion = getVersionFromPluginUrl(pluginUrl)
if (latestVersion.toString() != currentVersion.toString()) {
haveChanges = true
pluginsToUpdate["${pluginName}"] = [currentVersion, latestVersion]
println("Plugin: ${pluginName} current version is ${currentVersion}, it will be updated to latest version: ${latestVersion}")
shwrap("""
Expand Down Expand Up @@ -116,8 +114,14 @@ node {
currentBuild.result = 'FAILURE'
throw e
} finally {
if (currentBuild.result == 'SUCCESS') {
currentBuild.description = "[${gitref}@${shortcommit}] ⚡"
} else {
currentBuild.description = "[${gitref}@${shortcommit}] ❌"
}
if (currentBuild.result != 'SUCCESS') {
pipeutils.trySlackSend(message: "bump-lockfile #${env.BUILD_NUMBER} <${env.BUILD_URL}|:jenkins:> <${env.RUN_DISPLAY_URL}|:ocean:> [${params.STREAM}]")
message = "build-${containername} #${env.BUILD_NUMBER} <${env.BUILD_URL}|:jenkins:> <${env.RUN_DISPLAY_URL}|:ocean:> [${gitref}@${shortcommit}]"
pipeutils.trySlackSend(color: 'danger', message: message)
}
}
}

0 comments on commit 1cc1685

Please sign in to comment.