make-deploy/test.sh

61 lines
1.3 KiB
Bash
Raw Normal View History

2024-06-05 07:29:49 +00:00
#!/bin/bash
set -e
DIR=$(mktemp -d)
TESTS=$DIR/make-deploy/testing
function prepdir() {
mkdir $DIR/make-deploy
cp -r * $DIR/make-deploy
cd $DIR
ln -s make-deploy/Makefile
touch secrets.mk
echo "::::::::: testing directory root: $DIR"
}
function cleandir(){
rm -fr $DIR
echo "::::::::: cleanup done"
}
function test_with_minimal_vars_apt(){
echo "::::::::: $FUNCNAME ::::::::::::"
cp $TESTS/apt_config.mk config.mk
make deploy
}
function test_with_minimal_vars_compose(){
echo "::::::::: $FUNCNAME ::::::::::::"
cp $TESTS/compose_config.mk config.mk
cp $TESTS/docker-compose.yml .
make deploy
2024-06-13 13:49:11 +00:00
rm -f docker-compose.yml config.mk
2024-06-05 07:29:49 +00:00
}
function test_with_minimal_vars_compose_file(){
echo "::::::::: $FUNCNAME ::::::::::::"
cp $TESTS/compose_file_config.mk config.mk
cp $TESTS/docker-compose.yml .
make deploy
2024-06-13 13:49:11 +00:00
rm -f docker-compose.yml config.mk
}
function test_with_minimal_vars_compose_and_tag(){
echo "::::::::: $FUNCNAME ::::::::::::"
cp $TESTS/compose_config.tag.mk config.mk
cp $TESTS/docker-compose.tag.yml docker-compose.yml
echo "TAG=3.17" > .env
make deploy
rm -f docker-compose.yml config.mk
2024-06-05 07:29:49 +00:00
}
prepdir
test_with_minimal_vars_apt
test_with_minimal_vars_compose
test_with_minimal_vars_compose_file
2024-06-13 13:49:11 +00:00
test_with_minimal_vars_compose_and_tag
2024-06-05 07:29:49 +00:00
cleandir