selfhosted-owncloud/deploy.sh

24 lines
548 B
Bash
Raw Normal View History

2023-12-24 20:15:46 +01:00
#!/bin/bash
2023-12-25 11:49:20 +01:00
cd /var/www/owncloud
2023-12-24 20:57:34 +01:00
# Check if .env file exists
if [ ! -f .env ]; then
echo "Error: .env file not found in /var/www/owncloud"
exit 1
fi
2023-12-25 10:05:19 +01:00
# Create network if it doesn't exist
2023-12-25 11:49:20 +01:00
if ! docker network ls | grep -q 'ocis-net'; then
docker network create --driver=overlay ocis-net
2023-12-25 10:05:19 +01:00
fi
# Automatically export all variables from .env file
set -a
source .env
set +a
2023-12-24 20:57:34 +01:00
2023-12-25 10:05:19 +01:00
# Deploy the stack
2023-12-24 20:23:56 +01:00
envsubst < docker-stack.yml | docker stack deploy selfhosted-owncloud --compose-file=docker-stack.yml --with-registry-auth --resolve-image always
2023-12-25 10:05:19 +01:00