mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-29 20:52:05 +08:00

* Deploy PRs to branches/ subdir. * wrong path to util * added PR number to file name * check for appveyor pr variable * also use branches if pushing a branch on windows * also use branches if pushing a branch on unix * wrong or operator on powershell
20 lines
715 B
PowerShell
Executable File
20 lines
715 B
PowerShell
Executable File
# Prerequisites
|
|
# Environment Variables:
|
|
# UPLOAD_USER - user to upload to sftp server
|
|
# KEY is assumed to be path to a ssh key for UPLOAD_USER
|
|
|
|
Param(
|
|
[string]$DIR,
|
|
[string]$KEY,
|
|
[string]$FILE
|
|
)
|
|
Set-Variable -Name "UUSER" -Value "$env:UPLOAD_USER"
|
|
Set-Variable -Name "UPLOAD" -Value "$($FILE | Resolve-Path)"
|
|
if (Test-Path $KEY) {
|
|
if ($env:APPVEYOR_PULL_REQUEST_NUMBER -Or $env:APPVEYOR_REPO_BRANCH -ne "master" ) {
|
|
winscp.com /privatekey=$KEY /command "open sftp://$UUSER@dl.slic3r.org/$DIR/branches -hostkey=*" "put $UPLOAD ./$FILE" "exit"
|
|
} else {
|
|
winscp.com /privatekey=$KEY /command "open sftp://$UUSER@dl.slic3r.org/$DIR -hostkey=*" "put $UPLOAD ./$FILE" "exit"
|
|
}
|
|
}
|