# 版本号
$version = "1.0.2"

$csprojFile =  '..\.\*.csproj'
$files = Get-ChildItem -Path $csprojFile
$fullPath = $files[0]
$name = $fullPath.BaseName
 
Write-Host "准备登录到镜像仓库服务器"
docker login 192.168.111.248:10001 --username=jenkins --password GTCz3pV8kdme4rh5
 
$lowerName = $name.toLower()

$tagName = "$($lowerName):$($version)"

Write-Host "开始打包镜像"
Write-Host $tagName

docker build --build-arg BUD_ENV=Production --progress=plain -t $tagName .

Write-Host "镜像打包成功";

docker tag $tagName "192.168.111.248:10001/jisheyun/jishe.testservice:$($version)"

Write-Host "开始推送镜像服务";
#docker push "192.168.111.248:10001/jisheyun/jishe.testservice:$($version)"
