runtime/tests2.fish

23 lines
735 B
Fish
Raw Normal View History

2021-11-19 22:52:57 +00:00
#!/usr/bin/fish
if test -z "$DOCKER"
set DOCKER docker
end
set CONTAINER_NAME dev_test
for line in (cat Dockerfile | grep "RUN build_" | sed "s/RUN build_//" | sed "s/\.sh//" | sed "s/php8/php/")
set tech (string split " " $line)[1]
set tech_version (string split " " $line)[2]
echo "Testing $tech $tech_version"
$DOCKER run -d --rm --name $CONTAINER_NAME harbor.hq.rosti.cz/rosti/runtime:test > /dev/null; or exit 1
$DOCKER exec -e TESTMODE=1 -e MENUITEM=tech -e TECH=$tech-$tech_version $CONTAINER_NAME su app -c rosti > /dev/null; or exit 1
sleep 3
$DOCKER exec $CONTAINER_NAME curl --head http://localhost:8000 | grep "HTTP/1.1 200"; or exit 2
$DOCKER stop $CONTAINER_NAME; or exit 1
end