How do I dynamically trigger downstream builds in jenkins?

前端 未结 6 493
刺人心
刺人心 2020-12-14 20:34

We want to dynamically trigger integration tests in different downstream builds in jenkins. We have a parametrized integration test project that takes a test name as a param

6条回答
  •  难免孤独
    2020-12-14 20:52

    Using the Groovy Postbuild Plugin, maybe something like this will work (haven't tried it)

    def job = hudson.getItem(jobname)
    hudson.queue.schedule(job)
    

    I am actually surprised that if you fingerprint both jobs (e.g. with the BUILD_TAG variable of the parent job) the aggregated results are not picked up. In my understanding Jenkins simply looks at md5sums to relate jobs (Aggregate downstream test results and triggering via the cli should not affect aggregating results. Somehow, there is something additional going on to maintain the upstream/downstream relation that I am not aware of...

提交回复
热议问题