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

View File

@@ -2,9 +2,9 @@ import {
type DomainSchema, type DomainSchema,
type Schema, type Schema,
type Template, type Template,
generateRandomDomain,
generateBase64, generateBase64,
generatePassword, generatePassword,
generateRandomDomain,
} from "../utils"; } from "../utils";
export function generate(schema: Schema): Template { export function generate(schema: Schema): Template {

View File

@@ -61,6 +61,11 @@ install_dokploy() {
docker swarm init --advertise-addr $advertise_addr 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" echo "Swarm initialized"
docker network rm -f dokploy-network 2>/dev/null docker network rm -f dokploy-network 2>/dev/null

View File

@@ -45,6 +45,11 @@ install_dokploy() {
docker swarm init --advertise-addr $advertise_addr 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" echo "Swarm initialized"
docker network rm -f dokploy-network 2>/dev/null docker network rm -f dokploy-network 2>/dev/null

View File

@@ -60,6 +60,11 @@ install_dokploy() {
docker swarm init --advertise-addr $advertise_addr 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" echo "Swarm initialized"
docker network rm -f dokploy-network 2>/dev/null docker network rm -f dokploy-network 2>/dev/null