Explorar el Código

add dotnet react build

shayne_lo hace 5 meses
padre
commit
e667c00de9
Se han modificado 2 ficheros con 25 adiciones y 2 borrados
  1. 25 2
      Dev_Build_React.ps1
  2. 0 0
      Dockerfile_React

+ 25 - 2
ReactTest_Build.ps1 → Dev_Build_React.ps1

@@ -28,15 +28,38 @@ $tagname= $dev_prefix + $username
 $fulltag=$fullregistryname+"/"+$imagerepositoryname+":"+$tagname
 $imagename = $imagerepositoryname+":"+$tagname
 
+
+$response = read-host  "please confirm that what you are currently uploading is a test version[ $fulltag ]. (y/n)"
+
+
+if ($response -eq "y") {
+ write-host "upload processing....."
+
+
+ #解除image鎖定
+ az acr repository update --name $registryname --image $imagename --delete-enabled true --write-enabled true
+ 
 $ssha = git rev-parse --short head
 
+ Write-Host "ACR Login....."
+ $token = az acr login --name $registryname --expose-token --output tsv --query accessToken
+ $user = "00000000-0000-0000-0000-000000000000"
+ podman login $fullregistryname -u $user -p $token
+ 
 #wite ssha to file
 $ssha | Out-File ssha
 
 rm -r ./app
 dotnet publish .\EVCB_OCPP.WSServer\EVCB_OCPP.WSServer.csproj -c Release -o ./app/publish /p:UseAppHost=false
 & 'C:\Program Files (x86)\Eziriz\.NET Reactor\dotNET_Reactor.Console.exe' -file ./app/publish/EVCB_OCPP.WSServer.dll -targetfile ./app/publish/EVCB_OCPP.WSServer.dll
-podman build ./ -f Dockerfile_dev -t  $fulltag --label [gitcommit=$ssha,author=$username]
+podman build ./ -f Dockerfile_React -t  $fulltag --label [gitcommit=$ssha,author=$username]
+podman push $fulltag
 
 #remove ssha file
-Remove-Item ssha
+Remove-Item ssha
+
+ #鎖定image
+ az acr repository update --name $registryname --image $imagename --delete-enabled false --write-enabled false
+} else {
+ write-host "please modify the parameters with scripts."
+}

+ 0 - 0
Dockerfile_dev → Dockerfile_React