-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocal-test.sh
executable file
·40 lines (32 loc) · 963 Bytes
/
local-test.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
#!/bin/bash
BUILD_NO_CACHE=''
while (( $# > 0 ))
do
case $1 in
-n | --no-cache)
BUILD_NO_CACHE=true
;;
-* | --*)
echo "invalid option"
exit 1
;;
esac
shift
done
if [ $BUILD_NO_CACHE ]; then
docker-compose build --no-cache
fi
docker-compose up -d
echo -e '\namazonlinux2023: test start'
docker-compose exec amazonlinux2023 sh -c "cd /usr/local/src/my-shell-scripts && shellspec"
echo -e 'amazonlinux2023: test end\n'
echo -e '\nredhat-ubi8: test start'
docker-compose exec redhat-ubi8 sh -c "cd /usr/local/src/my-shell-scripts && shellspec"
echo -e 'redhat-ubi8: test end\n'
echo -e '\nredhat-ubi9: test start'
docker-compose exec redhat-ubi9 sh -c "cd /usr/local/src/my-shell-scripts && shellspec"
echo -e 'redhat-ubi9: test end\n'
echo -e '\nubuntu22.04: test start'
docker-compose exec ubuntu22.04 sh -c "cd /usr/local/src/my-shell-scripts && shellspec"
echo -e 'ubuntu22.04: test end\n'
docker-compose down