mirror of https://github.com/portainer/portainer
parent
29a041e072
commit
292e525539
|
@ -1,7 +1,17 @@
|
|||
param (
|
||||
[string]$platform,
|
||||
[string]$arch
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop";
|
||||
|
||||
$binary = "portainer.exe"
|
||||
$project_path = $((Get-Location).Path)
|
||||
|
||||
New-Item -Name dist -Path "$project_path" -ItemType Directory | Out-Null
|
||||
Set-Location -Path "$project_path\api\cmd\portainer"
|
||||
|
||||
# copy templates
|
||||
Copy-Item -Path "./mustache-templates" -Destination "./dist" -Recurse
|
||||
|
||||
|
||||
$ErrorActionPreference = "Stop";
|
||||
C:\go\bin\go.exe get -t -d -v ./...
|
||||
C:\go\bin\go.exe build -v
|
||||
|
||||
Move-Item -Path "$($binary)" -Destination "..\..\..\dist"
|
||||
|
|
|
@ -2,6 +2,11 @@
|
|||
|
||||
set -x
|
||||
|
||||
DEBUG=${DEBUG:-""}
|
||||
if [ -n "$DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
mkdir -p dist
|
||||
|
||||
# populate tool versions
|
||||
|
@ -22,14 +27,14 @@ go get -t -d -v ./...
|
|||
|
||||
# the build takes 2 seconds
|
||||
GOOS=$1 GOARCH=$2 CGO_ENABLED=0 go build \
|
||||
-trimpath \
|
||||
--installsuffix cgo \
|
||||
--ldflags "-s \
|
||||
-trimpath \
|
||||
--installsuffix cgo \
|
||||
--ldflags "-s \
|
||||
--X 'github.com/portainer/portainer/api/build.BuildNumber=${BUILDNUMBER}' \
|
||||
--X 'github.com/portainer/portainer/api/build.ImageTag=${CONTAINER_IMAGE_TAG}' \
|
||||
--X 'github.com/portainer/portainer/api/build.NodejsVersion=${NODE_VERSION}' \
|
||||
--X 'github.com/portainer/portainer/api/build.YarnVersion=${YARN_VERSION}' \
|
||||
--X 'github.com/portainer/portainer/api/build.WebpackVersion=${WEBPACK_VERSION}' \
|
||||
--X 'github.com/portainer/portainer/api/build.GoVersion=${GO_VERSION}'" \
|
||||
-o "../dist/portainer" \
|
||||
./cmd/portainer/
|
||||
--X 'github.com/portainer/portainer/api/build.GoVersion=${GO_VERSION}'" \
|
||||
-o "../dist/portainer" \
|
||||
./cmd/portainer/
|
||||
|
|
Loading…
Reference in New Issue