#!/bin/bash



Wai=$(realpath $(dirname $0))

source ${Wai}/Template/function

TestEnv realpath
TestEnv docker
TestEnv tput

cd ${Wai}

Exec=$1

[[ -z "${Exec}" ]] && help 
[[ "${Exec}" == "image" ]] && GenAll
[[ "${Exec}" == "image-gen" ]] && DockerGen gen
[[ "${Exec}" == "image-repo" ]] && DockerGen repo
[[ "${Exec}" == "repo" ]] && DockerComposeRun repo
[[ "${Exec}" == "stop" ]] && DockerStop
[[ "${Exec}" == "gen" ]] && DockerComposeRun gen 
[[ "${Exec}" == "run-gen" ]] && DockerConnect gen $2
[[ "${Exec}" == "run-repo" ]] && DockerConnect repo $2
[[ "${Exec}" == "ps" ]] && DockerPs


if [[ "${Exec}" == "all" ]]
	then
		GenAll
		DockerComposeRun repo 
		DockerComposeRun gen Print
fi


