How to test an entire pipeline locally, that contains jobs with dependencies?

Debugging .gitlab-ci.yml locally with jobs that contain dependencies

I’m using the GitLab runner to debug locally this .gitlab-ci.yml

image: "openfoam-v2012_ubuntu:focal"
 
stages:
  - build
  - run
  - visualize 
  # - test
 
build_apps:
  stage: build 
  script:
    - source /opt/OpenFOAM/OpenFOAM-v2012/etc/bashrc || true
    - ./Allwmake 
    - ls $FOAM_USER_APPBIN
    - ls $FOAM_APPBIN
  artifacts:
    paths:
        - /root/OpenFOAM/-v2012/platforms/linux64GccDPInt32Opt/bin/foamTestFvcReconstruct 
 
param_study:
  stage: run 
  dependencies:
    - build_apps
  script: 
    - source /opt/OpenFOAM/OpenFOAM-v2012/etc/bashrc || true
    - ls $FOAM_USER_APPBIN

In the build_apps job, executables are compiled and installed that are required in param_study. Is it possible to debug the entire pipeline locally, and not just a single job using a command similar to the one below?

sudo gitlab-runner exec docker --docker-pull-policy never build_apps

I expected it to be possible to execute the entire pipeline, or a sub-set of the pipeline, along these lines:

sudo gitlab-runner exec docker --docker-pull-policy never build_apps param_study

But this doesn’t seem to be possible. Is there another argument to exec that tells the runner to execute every job in the pipeline? I haven’t found anything in the --help output. Thanks!

Hi @tmaric

I haven’t tried gitlab-ci-local, but it looks like the kind of thing you are looking for.

2 Likes

Thanks @snim2 ! I’ll check it out!