#!/usr/bin/env bash

dockerRepo=hub.eazytec-cloud.com
DEVICE_TOKEN=7k5we0kmf0chyg87xc7t81vjuhfx99n6
USERNAME=zhi_xie
dockerImage=$dockerRepo/greenpark-ems/aiot-fe-online

if [ $? -ne 0 ];then
    echo "构建失败!"
else
  docker build -t "$dockerImage" .  && docker login -p "$DEVICE_TOKEN" -u "$USERNAME" "$dockerRepo" && docker push "$dockerImage"
fi
