Jenkins bushing continuous feedthrough

A simplified pipeline will look something like this:

1. build 2. unit test 3. deploy to dev 4. integration tests 5. deploy to prod 

For step # 5, I set up the Jenkins pipeline input command. We will not deploy prod with every commit, so if we stop all these tasks, it will have a large list of gray builds. Is it possible to have a skip option so that the assembly still displays as green blue?

+2
source share
3 answers

Can't you do something like this, it will be blue / green, whatever you choose from the input, and then you can start the deployment depending on this?

 def deploToProduction = true try{ input 'Deploy to Production' }catch(e){ deployToProduction = false } if(deployToProduction){ println "Deploying to production" } 
+3
source

There is a better solution that I just found. You can access the input result using the return value. The user must check the box to start an additional step. Otherwise, the step steps are skipped. If you skip the whole scene, the scene will disappear and “clear” the history of the scenes.

 stage('do optional stuff?') { userInput = input( id: 'userInput', message: "Some important question?", parameters: [ booleanParam(defaultValue: false, description: 'really?', name: 'myValue') ]) } stage('optional: do magic') { if (userInput) { echo "do magic" } else { // do what ever you want when skipping this build currentBuild.result = "UNSTABLE" } } 
0
source

Instead of using the pipeline as a function of Jenkins2 code, you can configure Jobs with a downstream / upstream configuration.

Assembly -> Unit test -> Deployment in Dev -> Integration tests -> Prod support -> Deploy to Prod

Currently, it gives more control over which version of the pipeline you want to use. For greater visibility, you can configure the “Delivery Pipeline” using the “Delivery-Pipeline-Plugin”.

-2
source

Source: https://habr.com/ru/post/1269692/


All Articles