Slic3r/package/deploy/winscp.ps1
Joseph Lenox b3cac9d0fb
Cleanup old branch builds (#4680)
* #4620

Invalidate posDetectSurfaces during make_perimeters() when posSlice would also get invalidated.
Can't use invalidate_step() as that invalidates the perimeters as well.

* Add a test step to check for regression #4620 - behavior on running Print::process() again on the same model.

* Fix naming scheme for macos/osx builds to make it obvious if it is a PR or not.

* Remove previous versions of the same kind of branch or PR ID

* Adjust copied statements to account for different calling conventions; osx does not have an arch name argument for make_dmg

* Remember to set the version too

* Update windows build server command to clean up old branch builds.

* Specifically look for PR${PR_ID} instead of just ${PR_ID} to avoid unintentional deletions.

* don't symlink pull requests

* Update to call more functions on osx

* Only delete/clean once, not once per file uploaded.
2019-01-06 13:53:41 -06:00

26 lines
1.1 KiB
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" ) {
if ($env:APPVEYOR_PULL_REQUEST_NUMBER) {
winscp.com /privatekey=$KEY /command "open sftp://$UUSER@dl.slic3r.org/$DIR/branches -hostkey=*" "rm *PR${env:APPVEYOR_PULL_REQUEST_NUMBER}*" "exit"
}
if ($env:APPVEYOR_REPO_BRANCH -ne "master" ) {
winscp.com /privatekey=$KEY /command "open sftp://$UUSER@dl.slic3r.org/$DIR/branches -hostkey=*" "rm *${env:APPVEYOR_REPO_BRANCH}*" "exit"
}
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"
}
}