fix(installation): exit of script when docker swarm init fails

This commit is contained in:
Mauricio Siu
2024-10-21 21:50:26 -06:00
parent 76585991ec
commit d7071fba60
4 changed files with 16 additions and 1 deletions
+1 -1
View File
@@ -2,9 +2,9 @@ import {
type DomainSchema,
type Schema,
type Template,
generateRandomDomain,
generateBase64,
generatePassword,
generateRandomDomain,
} from "../utils";
export function generate(schema: Schema): Template {
+5
View File
@@ -61,6 +61,11 @@ install_dokploy() {
docker swarm init --advertise-addr $advertise_addr
if [ $? -ne 0 ]; then
echo "Error: Failed to initialize Docker Swarm" >&2
exit 1
fi
echo "Swarm initialized"
docker network rm -f dokploy-network 2>/dev/null
+5
View File
@@ -45,6 +45,11 @@ install_dokploy() {
docker swarm init --advertise-addr $advertise_addr
if [ $? -ne 0 ]; then
echo "Error: Failed to initialize Docker Swarm" >&2
exit 1
fi
echo "Swarm initialized"
docker network rm -f dokploy-network 2>/dev/null
+5
View File
@@ -59,6 +59,11 @@ install_dokploy() {
advertise_addr=$(get_ip)
docker swarm init --advertise-addr $advertise_addr
if [ $? -ne 0 ]; then
echo "Error: Failed to initialize Docker Swarm" >&2
exit 1
fi
echo "Swarm initialized"