#!/bin/bash

if [ "$1" = 'mvn' ]; then
    mvn clean package -pl cas-server-webapp -am -DskipTests -T 4C
fi

name='cas-server:0.0.1'
repo_tag="dockerhub.test.wacai.info/donghuang/$name"
docker build -t "$name" -t "$repo_tag" .

if [ "$1" = 'push' ]; then
    docker push "$repo_tag"
fi
