Pipeline: Jenkins Release Plugin useless

71 views
Skip to first unread message

Sverre Moe

unread,
Apr 26, 2018, 4:38:52 AM4/26/18
to Jenkins Users
What use has Jenkins Release Plugin to Pipeline jobs?

According to documentation:
"The release plugin supports the Maven2 and Free Style Job type".

Still the release step is available as a pipeline step.

Jobs to Release, gives up nothing when I start type. Enter an actual project and gets
ERROR: Failed to load parameter definitions: Server Error
release 'jobProjectName'

So, it will trigger a release build of a maven2 project from a pipeline job.
Is this correct understanding of this plugin?

We no longer have any maven2 projects since all are now pipelines. I was then considering to uninstall this plugin. 

Ari Maniatis

unread,
Apr 29, 2018, 1:48:15 AM4/29/18
to Jenkins Users
I got rid of the release plugin and instead used the parameters plugin like this:

parameters {
    string(defaultValue: '', description: 'Release version. Leave blank to not release.', name: 'version')
}

stages {
    stage('Build') {
        steps {
            sh "./gradlew portal:build -Dbuild_number=${env.BUILD_NUMBER} -PreleaseVersion=${params.version}"
            junit 'portal/build/test-results/**/*.xml'
        }
    }

    stage('Create release') {
        when {
            expression { params.version != '' }
        }
        steps {
            script {
                currentBuild.displayName = "Release ${params.version}"
            }
            sh "./gradlew portal:publishExecutablesPublicationToExecutablesRepository -PreleaseVersion=${params.version}"
        }
    }
}

It looks a bit messy but works OK. Unfortunately there is no easy way in the Jenkins UI to show the latest release builds in a dashboard widget.
Reply all
Reply to author
Forward
0 new messages