How to add post-assembly action to a pipeline in Jenkins

Below is my pipeline script

node(Slave01) {
currentBuild.displayName = "${URL_Name}"
}
stage 'Pt2ctf process'
node(Slave01) {
build job: 'Pt2ctf_16_7', parameters: [string(name: 'URL_Name', value: "${URL_name}"), string(name: 'Display_Name', value: "${Display_Name}")]
}
stage 'add_fields'
node(Slave01) {
build job: 'add_fields_16_7', parameters: [string(name: 'URL_Name', value: "${URL_Name}")]
}

The above groovy script will run multiple builds in sequence. I have another assembly that will start after the sequence is completed. I do not see any post builds in the pipeline job configuration.

Is it possible that we can add a few more lines as shown below:

post
node(Slave01){
build job: 'testing_build'
}

Or do we have another option? please suggest

+7
source share
2 answers

post , . .

+6

-, - :

stage 'post-build'
node(Slave01){
build job: 'testing_build'
}

:

try {
    //Stages to be included in build
    ...
} catch {
    ...
} finally {
    stage 'post-build'
    ...
}
+4

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


All Articles