I want to debug a CI job from inside the server it’s running on.
This is a feature of other CI/CD systems, and I’m having trouble telling whether its supported on gitlab. Basically, I want to run a specific job, then before it finishes, suspend it, and then ssh into the container and “look around.”
This is a private gitlab instance.
I’m looking at the documentation here: https://docs.gitlab.com/ee/ci/ssh_keys/#ssh-keys-when-using-the-docker-executor
I’ve done all the steps described, the part I’m unsure of is how to target the container. (I’m also not 100% sure that the documentation linked is what I’m trying to do). In short:
- Create a new public/private key on my computer
- Add the private key as a variable to the project
- install the ssh-agent, and use the following commands in the
- 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )' - eval $(ssh-agent -s) - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - - mkdir -p ~/.ssh - chmod 700 ~/.ssh
Also, aren’t these steps backward?
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - - mkdir -p ~/.ssh - chmod 700 ~/.ssh
Should I be doing