Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

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



sort by: page size:

The runner is a pain in the butt to setup locally. Switch to gitlab or don't rely on community actions, run everything in single bash script.

Gitlab is awesome, its impressive what you get for free. Runners are nice, can run in powershell, bash, docker, vm , you name it.

The main problem with runner is that you cant easily execute build script on the host. Exec command isn't very useful and AFAIK deprecated.


Totally agree. Running your own gitlab runner is the feature of GitLab I would want the most on GitHub

How about GitLab and your own runner ?

Hm? Actually you can indeed test CI locally, if only one step at a time. This is a very very rare feature. It’s gitlab-runner exec.

Also, I find that running your own runner is super easy and straightforward.


Gitlab also runs locally.

Unfortunatelly there is still no way to run CI file locally which is major turn down. Deprecated `exec` command is hell to use.

I should be able to install runner on developers machine and just run and debug pipeline there, with or without Gitlab server present.


With the GitLab runner, you actually can execute anything you want on their server. It's sandboxed like any other CI service.

Cool that you'll give us a try. We're working to introduce mostly free CI Runners to GitLab.com. We already have a bunch but we're working on autoscaling them so there is less wait https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/...

> 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] https://github.com/firecow/gitlab-ci-local


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?

Gitlab has great built in support for CI [0], and you can easily add and run your own CI runners [1].

[0]: https://docs.gitlab.com/ce/ci/README.html

[1]: https://docs.gitlab.com/ce/ci/runners/README.html


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?

AFAIU you can't switch to a shell runner unless you self host gitlab runner.

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 thought using your own runners for free in Gitlab was already an option before Github Actions even existed

Sorry, I misread your comment as GitHub, not GitLab. I was unaware you can run CI runners on GitLab community version.

Just host your own runners https://docs.gitlab.com/runner/install/
next

Legal | privacy