'GitLab - dont wait for all jobs in the previous stage to be finished

In my pipeline, the two last stages are Deploy and Qa-test. It look like this: pipeline now

Now I need to run integration-tests automatically when the deploy-stag job is finished and not to wait for deploy-prod.

Is there some way to do this?



Solution 1:[1]

You can use needs to create an direct acyclic graph. If your integration-tests job needs the deploy-stag job, it will immediately start after deploy-stag is finished and will not wait for the remaining jobs in the deploy stage.

integration-tests:
  stage: qa-tests
  script:
    - echo "running qa tests"
  needs: ["deploy-stag"]

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 danielnelz