gitlab-runner allows you to run scripts locally for GitLab, but even that is lacking (any env secrets stored in GitLab? Script is going to fail).
I really, really wish there was a way to clone the GitHub Actions or GitLab runner environment, spin up a runner locally and test. That would shave off 95% of the wait time
> One thing that would be nice, however, would be the ability to run the entire pipeline locally.
This cost me many hours of waiting for the Gitlab CI runner when debugging non-trivial pipelines, when the issue was something that did not have to do with the script steps inside of the jobs but rather how the Gitlab runner handled things.
I've found gitlab-ci-local [1] which actually does run the Gitlab pipeline locally, although I had to write some boilerplaye scripts to set up all the necessary 'CI_FOO_SOMETHING' environment variables before running the tool. (Which sometimes came back to bite me because the issue was actually in the content of some of those environment variables). It's still a very good tool.
1. It does take some effort to get the gitlab-runner to run locally but it is possible to use the shell runner. This does require that you connect the gitlab-runner to an instance of GitLab. If I understand correctly, I think you're asking for the ability to take a `.gitlab-ci.yml` file and run the job(s) locally from your shell without requiring it go through the gitlab-runner and connecting to a GitLab instance. Please correct me if I'm off.
2. I'm not sure I understand what this means.
3. I think this is already possible. E.g. `curl https://gitlab.com/gitlab-org/security-products/license-mana.... Can you elaborate with a few more details on this?
There is gitlab-runner exec command which takes a ci yaml file and executes it, but it sux (A LOT), so they deprecated it.
This is not the same as taking a bash/powershell script and running it locally on runners host because gitlab inject into shell some stuff like secrets, env vars, artifacts, caches etc.
Some errors are VERY hard to reproduce when not on local executing environment.
Hi Carlos, Darren here, PM for runner. Can you provide a bit more insight in terms of some of the challenges that you are having with hosting your own runners? In regards to testing CI locally, did you mean having the ability to validate that a pipeline is fully functional prior to pushing your commit to GitLab?
To be fair, setting up a runner for Gitlab CI is very simple too. We self-host GitLab and we only have one runner on duty, but some projects have many stages that can be executed in parallel. I start a docker runner on my laptop before pushing new commits, which cuts the CI wait time by half.
I really, really wish there was a way to clone the GitHub Actions or GitLab runner environment, spin up a runner locally and test. That would shave off 95% of the wait time
reply