#!/bin/bash

VERSION=$(cat package.json \
  | grep version \
  | head -1 \
  | awk -F: '{ print $2 }' \
  | sed 's/[",]//g' \
  | tr -d '[[:space:]]')

TAG=easyv-admin:${VERSION}

docker build . -t ${TAG} --target production

docker tag ${TAG} registry.cn-hangzhou.aliyuncs.com/easyv/${TAG}

echo "registry.cn-hangzhou.aliyuncs.com/easyv/${TAG}"