In a Jenkins pipeline, how can I wait on post build actions of a step before moving to the next step?

My Jenkins pipeline is

pipeline {
    agent any
    stages {
        stage('deploy') {
            steps {
                build(job: 'jobA')
                build(job: 'jobB')
            }
        }
    }
}

I want to run jobB when jobA is done. However jobA is a deploy/release job:

  1. it builds a docker image and
  2. it deploys that docker image as a post build action.

So jobA = 1_build_docker + 2_deploy_docker (as a post build action)

Problem: How can I start jobB when 2_deploy_docker is done? With my current pipeline, jobB starts when 1_build_docker is done



Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation