forked from postgis/docker-postgis
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlocaltest.sh
executable file
·78 lines (63 loc) · 1.92 KB
/
localtest.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/env bash
set -Eeuo pipefail
# Enable TEST mode and use the local registry at localhost:5000 (as specified in the .env.test file).
export TEST=true
# Source environment variables and necessary configurations
source tools/environment_init.sh
# Check if the container with name "registry" is already running
# https://docs.docker.com/registry/deploying/
docker ps -a
testregistry="postgistestregistry"
testregistry_cid=$(docker ps -q -f name="$testregistry")
echo "testregistry_cid=$testregistry_cid"
if [ -z "$testregistry_cid" ]; then
# Not running - start registry
docker pull registry:2
docker run -d -p 5000:5000 --restart=always --name "$testregistry" registry:2
# -v /mnt/registry:/var/lib/registry \
else
# If running, output a message
echo "Container with name: $testregistry is already running"
fi
# check update code
./update.sh
check-jsonschema --schemafile versions.schema.json versions.json
test_tag=17-3.5-bookworm
# check commands
make -n test-${test_tag}
make -n push-${test_tag}
make -n manifest-${test_tag}
# run commands
make test-${test_tag}
make push-${test_tag}
make manifest-${test_tag}
# check images
echo " "
echo " ---- generated images ---- "
make dockerlist
# check images
echo " "
echo " ---- check images exists ---- "
image_to_check="$test_tag"
if check_image_exists "$image_to_check"; then
echo "Image '$image_to_check' is available."
else
echo "Image '$image_to_check' does not exist."
echo "Unexpected error .. STOP"
exit 1
fi
# should not exists ....
if check_image_exists "99-9.9.9"; then
echo "exist - Unexpected error .. STOP"
exit 1
else
echo "OK: not found check is OK"
fi
# check registy
echo " --- registry --- "
make lregistryinfo
echo " "
echo "WARNING: Be carefull and not push the .localtest.sh script generated Dockerfiles,"
echo " because contains reference to the test REGISTRY, REPO_NAME and IMAGE_NAME!"
echo " "
echo "done."