• Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Critical Critical
    • multijob-plugin
    • None

      node('maven3.6') {
                properties([
            parameters([
                string(
                    defaultValue: "",
                    description: '''Branch name to build different modules''',
                    name: 'Branchname'
                ),
           choice(
                  choices:"""development""",
                  description: '''Branch Type eg.development,feature''',
                  name: 'BranchType'
                   ),
               booleanParam(
                      defaultValue: false,
                      description: 'Build administration->admin',
                      name: 'Admin'),
            booleanParam(
                      defaultValue: false,
                      description: 'Build administration->admin-internal',
                      name: 'AdminInternal'),
            booleanParam(
                      defaultValue: false,
                      description: 'Build administration->admin-job',
                      name: 'AdminJob'),
            booleanParam(
                      defaultValue: false,
                      description: 'Build administration->admin-supplier',
                      name: 'AdminSupplier'),
            
            ]),
            buildDiscarder(
                logRotator(
                    artifactDaysToKeepStr: '',
                    artifactNumToKeepStr: '',
                    daysToKeepStr: '2',
                    numToKeepStr: '5')
            )
        ])

        stage("Trigger multiple admin jobs") {
          List Joblist = new ArrayList()

          if (params.Admin)

      {       Joblist.add("admin")     }

        

          if (params.AdminInternal)

      {       Joblist.add("admin-internal")     }

          if (params.AdminJob)

      {       Joblist.add("admin-job")     }

          if (params.AdminSupplier)

      {       Joblist.add("admin-supplier")     }

          
          echo "Job List to build : ${Joblist}"
          echo "Branch Name : ${Branchname}"

       

          if (Joblist.size() > 0) {
            if("${Branchname}"=="development"|"${Branchname}"=="master")  {
              BRANCH_TO_TAG="${Branchname}"
            } else {
              BRANCH_TO_TAG="${BranchType}/${Branchname}"
            }

       

            for (Job in Joblist) {
              echo "Building Job : ${Job}"
              catchError {
                  if ("${Job}"== "admin"|"${Job}"== "admin-job"|"${Job}"== "admin-internal"|"${Job}"== "admin-supplier") {
                      build job: "administration/$Job/${BRANCH_TO_TAG}", wait:false
                  } else {
                      build job: "$Job/${BRANCH_TO_TAG}", wait:false
                  }
              }
            }
          }
        }
      }  

      It is successfull. The above script is written to just trigger all 4 pipeline jobs in only 1 single pipeline. But what stage can be added next so that, this single pipeline waits for the other pipeline jobs selected to complete the run and show the output whether all the selected pipelines are successful or failed with what error and which job. Please provide that stage

          [JENKINS-70759] What stage would serve the purpose

          Mark Waite added a comment -

          This looks like a request for help developing a Pipeline script.

          The Jenkins issue tracker is used to track bugs and enhancement requests. The community forum at https://community.jenkins.io and the chat channels at https://www.jenkins.io/chat/ are better places for question and answer.

          Mark Waite added a comment - This looks like a request for help developing a Pipeline script. The Jenkins issue tracker is used to track bugs and enhancement requests. The community forum at https://community.jenkins.io and the chat channels at https://www.jenkins.io/chat/ are better places for question and answer.

            Unassigned Unassigned
            dj_123 Dheeraj
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: