1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-05 13:55:21 +02:00

fix(build-system): fix local build system after appveyor introduction (#2528)

This commit is contained in:
Anthony Lapenna 2018-12-09 16:08:36 +13:00 committed by GitHub
parent 65979709e9
commit 79c24ced96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 106 additions and 51 deletions

9
build/build_binary.ps1 Normal file → Executable file
View file

@ -8,17 +8,10 @@ $ErrorActionPreference = "Stop";
$binary = "portainer.exe"
$project_path = (Get-ITEM -Path env:APPVEYOR_BUILD_FOLDER).Value
Set-Item env:GOPATH "$project_path\api"
New-Item -Name dist -Path "$project_path" -ItemType Directory | Out-Null
New-Item -Name portainer -Path "$project_path\api\src\github.com\" -ItemType Directory | Out-Null
Copy-Item -Path "$project_path\api" -Destination "$project_path\api\src\github.com\portainer" -Recurse -Force -ErrorAction:SilentlyContinue
Rename-Item -Path "$project_path\api\src\github.com\portainer\api" -NewName "portainer" -ErrorAction:SilentlyContinue
Set-Location -Path "$project_path\api\cmd\portainer"
C:\go\bin\go.exe get -t -d -v ./...
C:\go\bin\go.exe build -v
Move-Item -Path "$project_path\api\cmd\portainer\$($binary)" -Destination "$project_path\dist"
Move-Item -Path "$($binary)" -Destination "..\..\..\dist"

View file

@ -1,14 +1,9 @@
export GOPATH="$APPVEYOR_BUILD_FOLDER/api"
binary="portainer"
mkdir -p dist
mkdir -p api/src/github.com/portainer/
cp -R api/ api/src/github.com/portainer/portainer/
cd 'api/cmd/portainer'
go get -t -d -v ./...
GOOS=$1 GOARCH=$2 CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags '-s'
mv "$APPVEYOR_BUILD_FOLDER/api/cmd/portainer/$binary" "$APPVEYOR_BUILD_FOLDER/dist/portainer"
mv "${binary}" "../../../dist/portainer"

24
build/build_binary_appveyor.ps1 Executable file
View file

@ -0,0 +1,24 @@
param (
[string]$platform,
[string]$arch
)
$ErrorActionPreference = "Stop";
$binary = "portainer.exe"
$project_path = (Get-ITEM -Path env:APPVEYOR_BUILD_FOLDER).Value
Set-Item env:GOPATH "$project_path\api"
New-Item -Name dist -Path "$project_path" -ItemType Directory | Out-Null
New-Item -Name portainer -Path "$project_path\api\src\github.com\" -ItemType Directory | Out-Null
Copy-Item -Path "$project_path\api" -Destination "$project_path\api\src\github.com\portainer" -Recurse -Force -ErrorAction:SilentlyContinue
Rename-Item -Path "$project_path\api\src\github.com\portainer\api" -NewName "portainer" -ErrorAction:SilentlyContinue
Set-Location -Path "$project_path\api\cmd\portainer"
C:\go\bin\go.exe get -t -d -v ./...
C:\go\bin\go.exe build -v
Move-Item -Path "$project_path\api\cmd\portainer\$($binary)" -Destination "$project_path\dist"

14
build/build_binary_appveyor.sh Executable file
View file

@ -0,0 +1,14 @@
export GOPATH="$APPVEYOR_BUILD_FOLDER/api"
binary="portainer"
mkdir -p dist
mkdir -p api/src/github.com/portainer/
cp -R api/ api/src/github.com/portainer/portainer/
cd 'api/cmd/portainer'
go get -t -d -v ./...
GOOS=$1 GOARCH=$2 CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags '-s'
mv "$APPVEYOR_BUILD_FOLDER/api/cmd/portainer/$binary" "$APPVEYOR_BUILD_FOLDER/dist/portainer"

0
build/ci-linux.sh Normal file → Executable file
View file

0
build/ci-windows.ps1 Normal file → Executable file
View file

0
build/download_docker_binary.ps1 Normal file → Executable file
View file

0
build/release-linux.sh Normal file → Executable file
View file

0
build/release-windows.ps1 Normal file → Executable file
View file