Expose server SSH host and port in predefined CI variables
What does this MR do and why?
This exposes the server SSH port (and host) in predefined CI variables and makes it available in CI jobs, so it can be used for constructing/parsing SSH URLs on the runner or in the job itself.
Context:
Adding support for absolute submodule URLs in Add support for absolute submodule URLs (gitlab-runner!3198 - merged), this will help with additional scenarios when an instance uses a non-standard SSH port.
Screenshots or screen recordings
Successful run on GDK with local shell runner:
How to set up and validate locally
- Using GDK:
# in ./gitlab/:
git remote add community https://gitlab.com/gitlab-community/gitlab.git
git checkout community/feat/ci-server-ssh-port-variable
gdk start
-
Follow GDK runner setup https://gitlab.com/gitlab-org/gitlab-development-kit/blob/main/doc/howto/runner.md#simple-configuration
-
Run a simple job in a test repo,
.gitlab-ci.yml
:
test:
script:
- echo $CI_SERVER_SHELL_SSH_PORT
- echo $CI_SERVER_SHELL_SSH_HOST
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.