Automatic testing script
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
This commit is contained in:
parent
69464ac670
commit
7fc67804a8
12
.drone.yml
12
.drone.yml
@ -38,4 +38,14 @@ steps:
|
|||||||
privileged: true
|
privileged: true
|
||||||
commands:
|
commands:
|
||||||
- echo "$password" | podman login -u $username --password-stdin $repo
|
- echo "$password" | podman login -u $username --password-stdin $repo
|
||||||
- make DOCKER=podman build
|
- make VERSION=test DOCKER=podman build
|
||||||
|
- name: test image
|
||||||
|
image: harbor.hq.rosti.cz/library/builder:35
|
||||||
|
environment:
|
||||||
|
username: robot$rosti+rosti
|
||||||
|
password:
|
||||||
|
from_secret: repo_password
|
||||||
|
repo: harbor.hq.rosti.cz
|
||||||
|
privileged: true
|
||||||
|
commands:
|
||||||
|
- make DOCKER=podman VERSION=test test
|
||||||
|
2
Makefile
2
Makefile
@ -9,7 +9,7 @@ build:
|
|||||||
$(DOCKER) build -t ${REPO}:dev .
|
$(DOCKER) build -t ${REPO}:dev .
|
||||||
|
|
||||||
test:
|
test:
|
||||||
DOCKER=$(DOCKER) ./tests.sh
|
DOCKER=$(DOCKER) ./tests2.sh
|
||||||
|
|
||||||
squashed:
|
squashed:
|
||||||
$(DOCKER) pull debian:buster
|
$(DOCKER) pull debian:buster
|
||||||
|
22
tests2.fish
Normal file
22
tests2.fish
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#!/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
|
Loading…
Reference in New Issue
Block a user