#!/usr/bin/env bash
#
# customise for your development fork

NAME=$1
DEV_REPO="development/zdc-addons"
DEV_BRANCH="dev"

echo "### Stop odoo service"
multipass exec $NAME -- sudo systemctl stop odoo12.service

echo "### Remove old dev repostitory"
multipass exec $NAME -- sudo rm -r /home/ubuntu/custom/dev-addons

echo "### Clone new dev repository"
multipass exec $NAME -- /usr/bin/git clone git@gitea.egroup.sk:$DEV_REPO --depth 1 --branch $DEV_BRANCH /home/ubuntu/custom/dev-addons

echo "### Start odoo service"
multipass exec $NAME -- sudo systemctl start odoo12.service
