How to use netcat inside a gitlab-ci.yml

一笑奈何 提交于 2019-12-10 14:17:50

问题


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

来源:https://stackoverflow.com/questions/43409794/how-to-use-netcat-inside-a-gitlab-ci-yml

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!