Repository navigation
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
executable file
·65 lines (51 loc) · 1.76 KB
/
Copy pathdocker-entrypoint.sh
File metadata and controls
executable file
·65 lines (51 loc) · 1.76 KB
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
#!/bin/sh
# SPDX-License-Identifier: FSL-1.1-ALv2
# Copyright (c) 2025 Delos Data, Inc.
set -e
GREEN='\033[0;32m'
EC='\033[0m'
export PYTHONPATH=/app/framework/tests
# Set the SSH_AUTH_SOCK environment variable to the forwarded ssh socket
export SSH_AUTH_SOCK=/tmp/ssh-agent/socket
# if there's an ssh socket mounted, use the host group id for the appuser
if [ -S /tmp/ssh-agent/socket ]; then
sudo groupadd -g `stat -c '%g' /tmp/ssh-agent/socket` ssh-agent-host
sudo usermod -aG ssh-agent-host appuser
fi
# if there's a docker socket mounted, use the host group id for the appuser
if [ -S /var/run/docker.sock ]; then
sudo groupadd -g `stat -c '%g' /var/run/docker.sock` docker-host
sudo usermod -aG docker-host appuser
fi
# copy tests to the framework tests directory
cp -r /app/tests/* /app/framework/tests/
# if helm charts are mounted, copy them to the framework charts directory
if [ -d /app/charts ]; then
cp -r /app/charts/* /app/framework/charts/
fi
# Make sure all python dependencies are installed
uv sync --all-packages --group dev
# RUN_MAKE_TARGET: when set, run that make target and exit (no banner/help, no shell)
if [ -n "${RUN_MAKE_TARGET}" ]; then
echo "Running make ${RUN_MAKE_TARGET}..."
if [ -S /var/run/docker.sock ]; then
# Switch to the new docker-host group to run the make target
exec sg docker-host -c "make ${RUN_MAKE_TARGET}"
else
exec make "${RUN_MAKE_TARGET}"
fi
fi
# Display the container banner
echo -e ""
echo -e "${GREEN}Production Test Framework"
echo -e "-------------------------${EC}"
echo -e ""
# Show the top level makefile target help
make help-container-targets
echo ""
echo "To run tests, run make using one of the targets shown above."
echo ""
echo "Example: make test"
echo ""
# Launch an interactive shell
exec /bin/sh -i