Debugging your gitlab-ci.yml in docker

Because gitlab-runner exec does not support submodules, is deprecated and that the alternative is not yet ready I changed my way of debugging .gitlab-ci.yml files. Here is my recipe:

script:
- set +e
- ...
- sleep 100d
  • wait for the crash
  • connect to the container using the following alias, and find what’s going on:
alias docker_exec_last='docker exec -e COLUMNS=$(tput cols) \
 -e LINES=$(tput lines) -it $(docker ps -ql -f status=running) bash'

This alias also contains a workaround for a docker exec bug about TTY sizing.

#docker, #gitlab