Find a way to do it with systemd or implement it directly in gitroot
Systemd can handle it see deploy an instance for more details