I feel like every few years I need to remember how to do this again, and every few years the way to run things locally changes. As of right now it feels like gitlab-ci-local works really well, so here is how to install and run jobs so I remember and maybe you will remember too.
Install gitlab-ci-local:
sudo wget -O /etc/apt/sources.list.d/gitlab-ci-local.sources https://gitlab-ci-local-ppa.firecow.dk/gitlab-ci-local.sources sudo apt-get update sudo apt-get install gitlab-ci-local
List available jobs in the repo:
gitlab-ci-local --list
Create a .gitlab-ci-local-variables.yml file. Copy any variables you need to run your jobs here. You might need to steal variables from your gitlab-ci instance, or create appropriate local version.
Run a particular job, for example build-dev:
gitlab-ci-local build-dev
This job relies on artifacts saved from the previous job:
gitlab-ci-local publish-pkg-dev