Hello Jenkins users,
 
I have a Multibrach-Pipeline on my Jenkins which creates a job per branch.
branch1,branch2,branch3
 
These jobs create jobs again via the jobdsl-plugin in Jenkinsfile:
def createJob(jobFile) {
    def job = readFile (jobFile)
    jobDsl scriptText: job 
}
 
with jobFile is something like:
 
pipelineJob("branch1-job1") {
    environmentVariables {
        [...]
    }
    throttleConcurrentBuilds {
        [...]
    }  
    triggers {
        [...]
    }
    definition {
        cps {        
            script(readFileFromWorkspace('jenkins/jobPipelineDef.groovy'))
            sandbox()
        }
    }
}
 
Now my question: Is there a way to delete the pipelineJob(branch1-job1) if the job for branch1 is deleted by the Multibranch-Pipeline? Or do I have to manually determine the jobs and delete them via the jobDsl-plugin?
Platform: Jenkins ver. 2.46.2 with all plugins are up to date.
I have already asked the users at Stackoverflow, but unfortunately no answer received: http://stackoverflow.com/questions/43679852/jenkins-delete-job-created-by-multibranch-pipeline-with-jobdsl-when-branch- Is
 
Perhaps one of you can help me.
Thanks!
Robert
 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/trinity-4bfb5bd5-deb8-4132-82b8-04b51ac1dc51-1493731441607%403capp-webde-bs10.
For more options, visit https://groups.google.com/d/optout.

Reply via email to