How to use netcat inside gitlab-ci.yml

I am trying to verify that the service is inside a gitlab runner.

For this, I use netcatin 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
+5
source share

Source: https://habr.com/ru/post/1016555/


All Articles