#!/bin/bash

# script should fail when any process returns non zero code
set -ev

# create client
npm run build

# create and push new docker container
docker build -f compose/django/Dockerfile -t iterativ/vbv-lernwelt-django .
docker push iterativ/vbv-lernwelt-django

# deploy to caprover
caprover deploy -h https://captain.control.iterativ.ch -a vbv-lernwelt -i docker.io/iterativ/vbv-lernwelt-django
