-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest
More file actions
executable file
·38 lines (32 loc) · 1002 Bytes
/
test
File metadata and controls
executable file
·38 lines (32 loc) · 1002 Bytes
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
#!/usr/bin/env bash
set -e
cd "$(dirname "$0")"
source $(dirname "$0")/.common.sh
DC_CMD="docker compose -f test.yml "
function cleanup {
echo "Cleaning up containers..."
$DC_CMD --progress quiet down --timeout 0 --remove-orphans --volumes >/dev/null || true
}
function finalize {
cleanup
}
trap finalize EXIT
#if $1 is passed, thats our target
if [ -n "$1" ]; then
$DC_CMD --progress plain up --build $1
exit $?
fi
echo "Pulling base images ... "
docker_pull_base_images "Alpine.Dockerfile"
cleanup
echo "Running tests ... "
if ! $DC_CMD --progress none up --detach --wait --build test; then
banner "Failure!"
echo "${COLOR_RED}Container build tests failed in ${COLOR_YELLOW}${SECONDS} seconds${COLOR_RED}.${COLOR_RESET}"
echo " Hint: Try running ${COLOR_YELLOW}${0} failed-target${COLOR_RESET} to see more details."
ring_bell "fail"
exit 1
fi
echo "${COLOR_GREEN}Container build tests passed in ${COLOR_YELLOW}${SECONDS} seconds${COLOR_GREEN}.${COLOR_RESET}"
ring_bell "okay"
exit 0