From d17a0434a3451b797dc28d81af026c3727c0c6c7 Mon Sep 17 00:00:00 2001 From: "Urko." Date: Mon, 25 Dec 2023 10:05:19 +0100 Subject: [PATCH] fix: deploy --- deploy.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/deploy.sh b/deploy.sh index 4fb3c22..48f6735 100644 --- a/deploy.sh +++ b/deploy.sh @@ -1,16 +1,21 @@ #!/bin/bash -# DEPLOYTIME=$(date +%s%3N) # Check if .env file exists if [ ! -f .env ]; then echo "Error: .env file not found in /var/www/owncloud" exit 1 fi +# Create network if it doesn't exist +if ! docker network ls | grep -q 'web '; then + docker network create --driver=overlay web +fi -export $(cat .env | xargs) +# Automatically export all variables from .env file +set -a +source .env +set +a + +# Deploy the stack envsubst < docker-stack.yml | docker stack deploy selfhosted-owncloud --compose-file=docker-stack.yml --with-registry-auth --resolve-image always -# curl -X POST https://log.spares.nu/api/annotations \ -# -H "Authorization: Bearer eyJrIjoiOGNhQVM5SkNaaEFlQ1FkTDFJNTdPNzhFazVuTko0TTEiLCJuIjoiZGVwbG95IiwiaWQiOjF9" \ -# -H "Content-Type: application/json" \ -# -d "{\"time\":${DEPLOYTIME},\"timeEnd\":${DEPLOYTIME},\"tags\":[\"deploy\"],\"text\":\"Docker Stack Deploy\"}"; echo +