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 ./...
|
|
|
|
go build -v
|
2019-01-30 22:37:16 +00:00
|
|
|
|
2019-03-15 06:08:35 +00:00
|
|
|
Move-Item -Path "$($binary)" -Destination "dist"
|