From ab278f03e17873dc423e011b49da4a480fb806fd Mon Sep 17 00:00:00 2001 From: Joseph Lenox Date: Thu, 6 Apr 2017 20:37:53 -0500 Subject: [PATCH] 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 --- package/deploy/sftp.sh | 6 ++++++ package/deploy/winscp.ps1 | 6 +++++- package/linux/make_archive.sh | 6 +++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/package/deploy/sftp.sh b/package/deploy/sftp.sh index c69e177d0..3fc786fc3 100755 --- a/package/deploy/sftp.sh +++ b/package/deploy/sftp.sh @@ -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 diff --git a/package/deploy/winscp.ps1 b/package/deploy/winscp.ps1 index af8fc407a..422d950e8 100755 --- a/package/deploy/winscp.ps1 +++ b/package/deploy/winscp.ps1 @@ -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" + } } diff --git a/package/linux/make_archive.sh b/package/linux/make_archive.sh index ed4d9cd70..1e34dc49a 100755 --- a/package/linux/make_archive.sh +++ b/package/linux/make_archive.sh @@ -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