I try to inspect that a service is up inside a gitlab runner.
For that I use netcat
in my .gitlab-ci.yml
image: python:latest
before_script:
- apt-get update -yq
- apt-get install -y python-dev python-pip tree
## check about Rabbit
- apt-get install -y curl netcat
- nc -v -zw3 rabbitmq 15672
but when I run I get this error::
Unpacking netcat (1.10-41) ...
Setting up netcat-traditional (1.10-41) ...
update-alternatives: using /bin/nc.traditional to provide /bin/nc (nc) in auto mode
Setting up netcat (1.10-41) ...
$ nc -zw3 rabbitmq 15672
$ nc -v -zw3 rabbitmq 15672
rabbitmq [172.17.0.2] 15672 (?) : Connection refused
ERROR: Job failed: exit code 1
netcat
with the-v
option for a more verbose output:nc -zw3 -v rabbitmq 15672
– Daphene