rm -rf app
cd Host
dotnet publish Host.csproj -c Release -o ../app
cd ../app
api_version="`date +%y%m%d.%H%M`.$BUILD_NUMBER"
git_commit_info=$(git show -s --format="由%an<%ae>于%ci提交，提交注释内容为：%s")
docker build -t registry.cn-beijing.aliyuncs.com/yhncore/hualian:$api_version --build-arg IMAGE_VERSION=$api_version --build-arg GIT_INFO="$git_commit_info" .
docker login -u microkj@163.com -p 12qwaszx registry.cn-beijing.aliyuncs.com
docker push registry.cn-beijing.aliyuncs.com/yhncore/hualian:$api_version

#docker rmi -f $(docker images |grep 'hualian'|awk '{print $3}')
curl -X PATCH \
  -H "content-type: application/strategic-merge-patch+json" \
  -H "Authorization:Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6ImVFQjdvUHljNEk2V0t2WmlWWkJIeTFldzZFSzBPRzNiS05NUEpaZWI2eWcifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJrdWJvYXJkLXVzZXItdG9rZW4teHM0ZGsiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoia3Vib2FyZC11c2VyIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQudWlkIjoiOGU0NWMyN2EtNmQyOC00MmY3LWI1OGUtZmRkZGFiOGMyMGZjIiwic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50Omt1YmUtc3lzdGVtOmt1Ym9hcmQtdXNlciJ9.c262cNjBWQC8u-KqyIW3-0Z9iKVcveL7gHKbfKQCMHbIoI2VthaUTwzr6ricHT5C_EzCAFUydLT_6yjot6i2_Np9Hcsha3zbBd5hqwlREeXmbJHsGfcd8pADERtJHHTChRy9FRfUZahsZEu7_QrlPp-YLMO5QafGjvZfxFwEkUaaPxqPt2gM4KTWOdqYhuhMyeDOagdO2sRMhawPMHymYhKwGyZ2HUSN0dFA3x91LFyNbPf_5wnd-naezI00lT8BUKKGt7Tf2nKOzxQfIQkhrDc3SMah0q0Xa9tOPJXJ3RDJfPeDR5bSeEF-rmEG5VRrNAjkLqEs4Vnx7csXoAi3kg" \
  -d '{"spec":{"template":{"spec":{"containers":[{"name":"host-api","image":"registry.cn-beijing.aliyuncs.com/yhncore/hualian:'$api_version'"}]}}}}' \
  "http://192.168.153.3:32567/k8s-api/apis/apps/v1/namespaces/hualian/deployments/svc-host-api"