diff --git a/snippets/check-port-is-reachable.sh b/snippets/check-port-is-reachable.sh new file mode 100644 index 0000000..9743afa --- /dev/null +++ b/snippets/check-port-is-reachable.sh @@ -0,0 +1,21 @@ +#!sh + +# Sources: +# - https://superuser.com/questions/621870/test-if-a-port-on-a-remote-system-is-reachable-without-telnet + +# TCP + +nc -vz -w '3' 'localhost' '80' +nc -nvz -w '3' '127.0.0.1' '80' + +timeout '3' cat < '/dev/tcp/localhost/80' +timeout '3' cat < '/dev/tcp/127.0.0.1/80' + + +# UDP + +nc -uvz -w '3' 'localhost' '25' +nc -nuvz -w '3' '127.0.0.1' '25' + +timeout '3' cat < '/dev/udp/localhost/80' +timeout '3' cat < '/dev/udp/127.0.0.1/25' diff --git a/snippets/gitlab.task.print-service-logs.yml b/snippets/gitlab.task.print-service-logs.yml new file mode 100644 index 0000000..d53c60c --- /dev/null +++ b/snippets/gitlab.task.print-service-logs.yml @@ -0,0 +1,16 @@ +--- + +print-postgis-service-logs: + when: manual + variables: + CI_DEBUG_SERVICES: "true" + services: + - name: "postgis/postgis:15-3.3" + alias: db + variables: + POSTGRES_DB: postgres + POSTGRES_USER: postgres + POSTGRES_PASSWORD: "postgres" + POSTGRES_HOST_AUTH_METHOD: trust + script: + - echo 'hello!!'