Introducing job dependencies will instruct the Intelligent Cache to include the output files in the dependent job. To simplify migration, needs and dependencies are both used to infer dependencies.

    The following example would share the build result, ./app, with the e2e (end-to-end) test job.

    build:
      script: build > ./app
    
    e2e:
      script:
      - ./app &
      - ./test
      needs: [ build ]
    

    Conditional 

    If dependencies are not already in use or would negatively impact execution outside of Cedar CI they can be added using rules:needs to make them conditional.

    e2e:
      rules:
      - if: $CEDARCI == "true"
        needs: [ build ]
      - when: success
    

    Simply configure a group or project variable when utilizing the Cedar CI runner to toggle the rule and add the dependency.

    Since the rules are evaluated on the Gitlab instance the variable needs to be present in Gitlab.