Local_Build.ps1 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # 設定 ASCII 藝術字的內容
  2. $asciiArt = @"
  3. _____ ________ ________ _ ____ _____ __ __ ______ _ _ _______
  4. | __ \| ____\ \ / / ____| | / __ \| __ \| \/ | ____| \ | |__ __|
  5. | | | | |__ \ \ / /| |__ | | | | | | |__) | \ / | |__ | \| | | |
  6. | | | | __| \ \/ / | __| | | | | | | ___/| |\/| | __| | . ` | | |
  7. | |__| | |____ \ / | |____| |___| |__| | | | | | | |____| |\ | | |
  8. |_____/|______| \/ |______|______\____/|_| |_| |_|______|_| \_| |_|
  9. "@
  10. # 顯示 ASCII 藝術字
  11. Write-Host $asciiArt
  12. #第一次建立專案請先設定ACR Name
  13. $registryname="evdevcontainerregistry"
  14. $fullregistryname="evdevcontainerregistry.azurecr.io"
  15. #第一次建立專案請先設定專案名稱
  16. $imagerepositoryname="dbapi"
  17. $dev_prefix = "dbapi_test_8019"
  18. $tagname= "dbapi_test_8019"
  19. $fulltag=$fullregistryname+"/"+$imagerepositoryname+":"+$tagname
  20. $imagename = $imagerepositoryname+":"+$tagname
  21. $ssha = git rev-parse --short head
  22. #wite ssha to file
  23. $ssha | Out-File gitcommit
  24. podman build ./ -t $fulltag --label [gitcommit=$ssha,author=$username]
  25. #remove ssha file
  26. Remove-Item gitcommit