J Fabian Meier
J Fabian Meier

Reputation: 35785

Manual promotion of pipeline results in Jenkins

We are currently moving from our legacy build server to Jenkins.

In our previous system, we had the following system:

  1. You don't directly build a release version, but you build a "BETA".
  2. After you are satisfied with the result, you can promote the "BETA" to "RELEASE".
  3. For that, you click on the build (the actual pipeline run) and click on a button "BETA to RELEASE".
  4. This button triggers a script to do the actual promotion (the actual steps are irrelevant for this question).

For Jenkins, I haven't found something like that yet. To be precise: I would like to choose one of the successful builds and then click on some kind of button to promote the results of that build to RELEASE. So even if I have build 1.2.0-BETA, 1.2.1-BETA and 1.2.2-BETA, I can choose 1.2.1-BETA and release it to 1.2.1.

What would be a good approach for this?

Upvotes: 6

Views: 3645

Answers (2)

SmartTom
SmartTom

Reputation: 821

I think that Promoted Builds Plugin is what you need.

Basically, after installing the plugin, you create a job that build your BETA version and in its configuration, you set up a promotion, manually approved, that run your promotion script.

Depending of your need, you maybe configure as well the number of days you want to keep the builds of the job.

Upvotes: 1

Saravanan
Saravanan

Reputation: 7854

I would like to suggest the following

We can create a Jenkins pipeline for an Application (Ex: API Services). In this API deployment pipeline, there are many stages,

  • Get source code from GIT
  • Restore the dependent libraries
  • Build the solution & generate the deployment artifacts (with suitable version , ex: Beta 1)
  • Deploy the artifacts to Dev environment
  • We have a wait time (ex: 1 day) using a timeout in Jenkins pipeline
  • Once the dev team validates the build and finds that it is suitable for promotion to QA
  • they click on Approve
  • Approved build gets updated with the version (ex: QA-1)
  • Await QA team approval
  • Once approved, move to production.

Reference Link: https://jenkins.io/doc/pipeline/steps/pipeline-input-step/

Example Snippet of pipeline code

 stage("Validate before Apply") {
                timeout(time:30, unit:'MINUTES') {
                    input 'Are you sure to promote this build to QA?'
                }
            }

Upvotes: 1

Related Questions