How to trigger a task inside a job from jenkins pipeline

353 Views Asked by At

I have a Maven project that builds a war file and a separate batch task inside the build job to deploy it to a server (this is basically a shell script executed on Jenkins).

This is the pipeline script:

    node {
stage('Build') {
    build job: 'core UAT'
   }
stage('Deploy') {
    build job: 'core UAT'
   }

Is there a way to specify something like:

stage('Deploy') {
    build job: 'core UAT -> Deploy'
   }

I suppose I could manually copy paste the batch task steps into the pipeline stage, but I want to trigger as if it was run explicitly.

This may help: task screenshot

0

There are 0 best solutions below