2019-01-30 22:37:16 +00:00
|
|
|
param (
|
|
|
|
[string]$platform,
|
|
|
|
[string]$arch
|
|
|
|
)
|
|
|
|
|
|
|
|
$ErrorActionPreference = "Stop";
|
|
|
|
|
|
|
|
$binary = "portainer.exe"
|
2019-05-29 04:57:30 +00:00
|
|
|
$go_path = "$($(Get-ITEM -Path env:AGENT_TEMPDIRECTORY).Value)\go"
|
2019-01-30 22:37:16 +00:00
|
|
|
|
2019-03-15 06:08:35 +00:00
|
|
|
Set-Item env:GOPATH "$go_path"
|
2019-01-30 22:37:16 +00:00
|
|
|
|
2019-03-21 05:46:49 +00:00
|
|
|
New-Item -Name dist -Path "." -ItemType Directory -Force | Out-Null
|
|
|
|
New-Item -Name portainer -Path "$go_path\src\github.com\portainer" -ItemType Directory -Force | Out-Null
|
2019-01-30 22:37:16 +00:00
|
|
|
|
2019-03-21 01:20:14 +00:00
|
|
|
Copy-Item -Path "api" -Destination "$go_path\src\github.com\portainer\portainer\api" -Recurse -Force -ErrorAction:SilentlyContinue
|
2019-01-30 22:37:16 +00:00
|
|
|
|
2019-03-15 06:08:35 +00:00
|
|
|
Set-Location -Path "api\cmd\portainer"
|
2019-01-30 22:37:16 +00:00
|
|
|
|
2019-05-29 04:57:30 +00:00
|
|
|
go get -t -d -v ./...
|
2019-10-10 03:29:00 +00:00
|
|
|
## go build -v
|
|
|
|
& cmd /c 'go build -v 2>&1'
|
2019-01-30 22:37:16 +00:00
|
|
|
|
2019-06-04 02:05:04 +00:00
|
|
|
Copy-Item -Path "portainer.exe" -Destination "$($env:BUILD_SOURCESDIRECTORY)\dist\portainer.exe" -Force -ErrorAction:SilentlyContinue
|