@echo off

set profile_name=test 
if not "%1"=="" ( 
    set profile_name=%1 
) 
cd ..
git pull
call mvn clean package -Dmaven.test.skip=true -P %profile_name%
cd docker
call copy.bat

docker stop wfc-gateway
docker rm wfc-gateway
docker rmi docker-wfc-gateway

docker stop wfc-auth
docker rm wfc-auth
docker rmi docker-wfc-auth

docker stop wfc-modules-file
docker rm wfc-modules-file
docker rmi docker-wfc-modules-file

docker stop wfc-modules-gen
docker rm wfc-modules-gen
docker rmi docker-wfc-modules-gen

docker stop wfc-modules-job
docker rm wfc-modules-job
docker rmi docker-wfc-modules-job

docker stop wfc-modules-system
docker rm wfc-modules-system
docker rmi docker-wfc-modules-system

docker stop wfc-modules-user
docker rm wfc-modules-user
docker rmi docker-wfc-modules-user

docker stop wfc-modules-payment
docker rm wfc-modules-payment
docker rmi docker-wfc-modules-payment

call deploy.bat backend