check if build was successful in scripts

This commit is contained in:
b1ek 2023-04-20 15:59:48 +10:00
parent 05c39487d8
commit 0c3ed4152e
Signed by: blek
GPG Key ID: 14546221E3595D0C
2 changed files with 8 additions and 0 deletions

4
dev.sh
View File

@ -11,6 +11,10 @@ cp docker-compose.dev docker-compose.yml
cp Dockerfile.dev Dockerfile
docker-compose build
if [ $? != 0 ]; then
echo "Error while building; check logs" >&2
exit -1
fi
echo -e "\033[1;32mDevelopment environment set up successfully\033[0m"
echo -e "Start it up with \033[1;32mdocker-compose up -d\033[0m!\n"

View File

@ -11,6 +11,10 @@ cp docker-compose.prod docker-compose.yml
cp Dockerfile.prod Dockerfile
docker-compose build
if [ $? != 0 ]; then
echo "Error while building; check logs" >&2
exit -1
fi
echo -e "\033[1;32mProduction environment set up successfully\033[0m"
echo -e "Start it up with \033[1;32mdocker-compose up -d\033[0m!\n"