wait for 443 port instead of sleep

This commit is contained in:
Alexander Tomokhov 2023-12-20 18:50:26 +04:00
parent a717ad6ca5
commit 4380a733a6

View file

@ -74,9 +74,14 @@ steps:
-H "Content-Type: application/json" -H "Content-Type: application/json"
--data '{"type":"TXT","name":"'"$$DOMAIN"'","content":"v=spf1 a mx ip4:$machineip -all","ttl":18000,"priority":10,"proxied":false}' --data '{"type":"TXT","name":"'"$$DOMAIN"'","content":"v=spf1 a mx ip4:$machineip -all","ttl":18000,"priority":10,"proxied":false}'
- name: sleep - name: wait for NixOS boot
environment:
DOMAIN:
from_secret: DOMAIN
TIMEOUT: 100
commands: commands:
- sleep 360 - sleep 300
- t0="$(date '+%s')"; until nix shell --inputs-from git+https://git.selfprivacy.org/alexoundos/selfprivacy-tests.git nixpkgs#netcat -c nc -zv -w1 "$DOMAIN" 443; do sleep 10; cur_date="$(date '+%s')"; remaining=$((t0 + TIMEOUT - cur_date)); [ "$remaining" -gt 0 ]; echo "$remaining seconds remain before teardown"; done
- name: test - name: test
environment: environment: