Deploy PRs to branches/ subdir. (#3865)

* 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
This commit is contained in:
Joseph Lenox 2017-04-06 20:37:53 -05:00 committed by GitHub
parent 04b59affce
commit ab278f03e1
3 changed files with 16 additions and 2 deletions

View File

@ -9,6 +9,12 @@ shift
KEY=$1
shift
FILES=$*
source $(dirname $0)/../common/util.sh
set_pr_id
set_branch
if [ ! -z ${PR_ID+x} ] || [ $current_branch != "master" ]; then
DIR=${DIR}/branches
fi
if [ -s $KEY ]; then
for i in $FILES; do

View File

@ -11,5 +11,9 @@ Param(
Set-Variable -Name "UUSER" -Value "$env:UPLOAD_USER"
Set-Variable -Name "UPLOAD" -Value "$($FILE | Resolve-Path)"
if (Test-Path $KEY) {
winscp.com /privatekey=$KEY /command "open sftp://$UUSER@dl.slic3r.org/$DIR -hostkey=*" "put $UPLOAD ./$FILE" "exit"
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"
}
}

View File

@ -26,7 +26,11 @@ install_par
# If we're on a branch, add the branch name to the app name.
if [ "$current_branch" == "master" ]; then
dmgfile=slic3r-${SLIC3R_BUILD_ID}-${1}.tar.bz2
if [ ! -z ${PR_ID+x} ]; then
dmgfile=slic3r-${SLIC3R_BUILD_ID}-${1}-PR${PR_ID}.tar.bz2
else
dmgfile=slic3r-${SLIC3R_BUILD_ID}-${1}.tar.bz2
fi
else
dmgfile=slic3r-${SLIC3R_BUILD_ID}-${1}-${current_branch}.tar.bz2
fi