#!/usr/bin/env bash

if ! docker swarm init | grep -q 'Error'
then
    docker swarm init
fi

cd $2
docker stack deploy -c docker-compose.yml traefik
cd ..

cd $1
docker stack deploy -c docker-compose.yml $1

cd $2
docker stack deploy -c docker-compose.yml traefik
cd ..