Skip to content

The GeneratedJob output doesn't show up on jenkinsfile runner console #718

Open
@nelsonq

Description

@nelsonq

Jenkins and plugins versions report

Environment
Paste the output here

What Operating System are you using (both controller, and any agents involved in the problem)?

Macos 14.3.1

Reproduction steps

  • Create folder ~/Work/apphome/jenkins-test
  • Create file Jenkinsfile
pipeline {
    agent any
    stages {
        stage('Build') {
            steps {
                script{
                    echo 'Hello world! This is parent job'
                    jobDsl(targets: "childjob.groovy")
                    build(job: "childjob")
                }
            }
        }
    }
}
  • Create file childjob.groovy
pipelineJob("childjob") {
	displayName("childjob")
    definition {
    	cps {
            script(readFileFromWorkspace('Jenkinsfile.childjob'))
            sandbox()
        }
	}
}
  • Create file Jenkinsfile.childjob
pipeline {
    agent any
    stages {
        stage('Build childjob') {
            steps {
                echo 'Hello world! this is child job'
            }
        }
    }
}
  • Execute the job
<path-to-jenkinsfile-runner>/app/target/appassembler/bin/jenkinsfile-runner \
  -w <path-to-jenkins-workhome> \
  --runWorkspace <path-to-jenkins-workspace> \
  -p <path-to-jenkins-plugins> \
  -f ~/Work/apphome/jenkins-test/Jenkinsfile

Expected Results

Hello world! this is child job message shows up in jenkinsfile runner log

Actual Results

no output message of Hello world! this is child job
only output message from parent job Hello world! This is parent job

Anything else?

Are you interested in contributing a fix?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions