Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nelsonq opened this issue Feb 12, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@nelsonq
Copy link

nelsonq commented Feb 12, 2024

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

@nelsonq nelsonq added the bug Something isn't working label Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant