
#!/usr/bin/env bash


APP_VER=1.0.0

echo "" > iot/Dockerfile
echo "FROM registry.zmyiot.com/rzcf/tomcat:8-jdk8u322" >> iot/Dockerfile
echo -e "MAINTAINER it@mail.rzcf.com\n"   >> iot/Dockerfile
echo -e "ENV APP_VER=1.0.0\n"  >> iot/Dockerfile


for PROJECT in ${PROJECTS[@]}
  do
    if [ "${PROJECT}" = "manager" ]; then
      echo "COPY ./jeecg-boot-module-system/target/jeecg-boot-module-system-${APP_VER}.war  /usr/local/tomcat/webapps/manager.war" >> iot/Dockerfile
    else
      echo "COPY ./${PROJECT}/target/${PROJECT}-${APP_VER}.war /usr/local/tomcat/webapps/${PROJECT}.war" >> iot/Dockerfile
    fi
  done


####################################
export PROJECTS='manager consumer listener mq-provider agent api'
sh -x GenDockerfile.sh
