Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to debug a Gitlab CI build interactively?

I have a build in Gitlab CI that takes a long time (10mins+) to run, and it's very annoying to wait for the entire process every time I need to experiment / make changes. It seems like surely there's a way to access some sort of shell during the build process and run commands interactively instead of placing them all in a deploy script.

I know it's possible to run Gitlab CI tests locally, but I can't seem to find a way to access the deploy running in process, even after scouring the docs.

Am I out of luck or is there a way to manually control this lengthy build?

like image 739
jamesfacts Avatar asked Sep 29 '17 21:09

jamesfacts


People also ask

What is GitLab Multirunner?

GitLab Runner is an application that works with GitLab CI/CD to run jobs in a pipeline. You can choose to install the GitLab Runner application on infrastructure that you own or manage.

Is GitLab continuous integration?

all tiers. GitLab CI/CD is a tool for software development using the continuous methodologies: Continuous Integration (CI)


1 Answers

I have not found a clean way for now, but here is how I do it

  1. I start building locally gitlab-runner exec docker your_build_name
  2. I kill gitlab-runner using control + c right after the docker image to be built. You can still add the command sleep 1m as the first script line just to have time enough to kill gitlab-runner Note: gitlab-runner will create a docker and then delete it once the job is done… killing it will ensure the docker is still there - no other alternative I know for now….
  3. Manually log into the container docker exec -i -t <instance-id/tag-name> bash
  4. Run your script commands manually…
like image 165
Flavien Volken Avatar answered Jan 01 '23 00:01

Flavien Volken