修改事务提交调用问题
This commit is contained in:
36
build.ps1
Normal file
36
build.ps1
Normal file
@@ -0,0 +1,36 @@
|
||||
Remove-Job *
|
||||
|
||||
$tasks = 0
|
||||
$start = Get-Date
|
||||
|
||||
$tasks++
|
||||
Write-Output "building platform for linux amd64..."
|
||||
Start-Job -ScriptBlock {
|
||||
$env:GOOS = "linux"; $env:GOARCH = "amd64"; go build -ldflags '-w -s' -o bin/platform_linux_amd64 cmd/main/main.go
|
||||
} | Out-Null
|
||||
|
||||
$tasks++
|
||||
Write-Output "building tasks for linux amd64..."
|
||||
Start-Job -ScriptBlock {
|
||||
$env:GOOS = "linux"; $env:GOARCH = "amd64"; go build -ldflags '-w -s' -o bin/tasks_linux_amd64 cmd/tasks/main.go
|
||||
} | Out-Null
|
||||
|
||||
# Wait for all jobs to complete
|
||||
while ($tasks -gt 0)
|
||||
{
|
||||
foreach ($job in Get-Job)
|
||||
{
|
||||
if ($job.State -eq "Completed")
|
||||
{
|
||||
$tasks--
|
||||
$job | Receive-Job
|
||||
$job | Remove-Job
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$end = Get-Date
|
||||
|
||||
Write-Output "build completed"
|
||||
Write-Output "time taken: $( ($end - $start).TotalSeconds ) seconds"
|
||||
Write-Output "output files are in ./bin/"
|
||||
Reference in New Issue
Block a user