On Mon, Nov 16, 2020 at 9:50 AM A richist <arichist@gmail.com> wrote:
Hi everyone,

I have what I feel like should be a basic use-case for Zuul, which I can't seem to get right.

I have a project with 2 jobs set up as:
- job:
    name: job1
    run:  <playbook>
    provides: build
    nodeset: nodeset1

- job:
    name: job2
    run:  <playbook>
    requires: build
    nodeset: nodeset2

- project:
    check:
      jobs:
        - job1
        - job2

As you might have guessed, job1 builds the project and saves an artifact, while job2 requires that artifact and does something with it.


I guess you're looking for dependencies: https://zuul-ci.org/docs/zuul/reference/job_def.html#attr-job.dependencies

i.e. make job2 depend on job1

check:
  jobs:
    - name: job2
      dependencies:
         - job1

for what it's worth we use this extensively in tripleo-ci if you will find many examples there https://opendev.org/openstack/tripleo-ci/src/commit/1b36059ce90106cf54c4ddc2af5683fc79005250/zuul.d/standalone-jobs.yaml#L505-L513

marios

 
I expected job1 to complete before job2 starts, however both jobs start simultaneously, which makes job2 unable to fulfill its purpose.

I tried setting job2 to inherit job1:
- job:
    name: job1
    run: <playbook>
    nodeset: nodeset1

- job:
    name: job2
    parent: job1
    post-run:  <playbook>
    nodeset: nodeset2

- project:
  check:
    jobs:
      - job2

However this seems to make job1's "run" playbook use "nodeset2", which is incompatible.
job1 must run on nodeset1 and job2 must run on nodeset2.
(Is there a way to make the "run" and "post-run" playbooks use different nodesets?)

I might be missing something obvious here, would really appreciate your assistance.

Regards,
Arichist
_______________________________________________
Zuul-discuss mailing list
Zuul-discuss@lists.zuul-ci.org
http://lists.zuul-ci.org/cgi-bin/mailman/listinfo/zuul-discuss