#!/bin/bash

if [ ! -d "./keycloak-cas/" ]
then
    git clone https://github.com/RoboJackets/keycloak-cas
    patch $(find . | grep UrlHelper.java) https_patch
fi
if [ -d "./target/" ]
then
	rm -r target/
fi
docker build -t build-dep .
docker create -it --name build-dep-container build-dep bash
docker cp build-dep-container:/target ./target
docker rm -f build-dep-container