Detect pull request id in deployment

This commit is contained in:
Joseph Lenox 2017-03-07 09:33:02 -06:00 committed by GitHub
parent f8e00b6e1b
commit dc8caeff5a

View File

@ -30,7 +30,15 @@ if [ -z ${current_branch+x} ]; then
current_branch="unknown" current_branch="unknown"
fi fi
if [ "$current_branch" == "master" ] && [ "$APPVEYOR_PULL_REQUEST_NUMBER" == "" ]; then if [ ! -z ${GITHUB_PR_NUMBER+x} ]; then
PR_ID=$GITHUB_PR_NUMBER
fi
if [ ! -z ${APPVEYOR_PULL_REQUEST_NUMBER+x} ]; then
PR_ID=$APPVEYOR_PULL_REQUEST_NUMBER
fi
if [ "$current_branch" == "master" ] && [ -z ${PR_ID} ]; then
# If building master, goes in slic3r_dev or slic3r, depending on whether or not this is a tagged build # If building master, goes in slic3r_dev or slic3r, depending on whether or not this is a tagged build
if [ -z ${TAGGED+x} ]; then if [ -z ${TAGGED+x} ]; then
SLIC3R_PKG=slic3r_dev SLIC3R_PKG=slic3r_dev
@ -40,8 +48,9 @@ if [ "$current_branch" == "master" ] && [ "$APPVEYOR_PULL_REQUEST_NUMBER" == ""
version=$SLIC3R_BUILD_ID version=$SLIC3R_BUILD_ID
else else
# If building a branch, put the package somewhere else. # If building a branch, put the package somewhere else.
echo "Delploying pull request $PR_ID"
SLIC3R_PKG=Slic3r_Branches SLIC3R_PKG=Slic3r_Branches
version=$SLIC3R_BUILD_ID-$current_branch version=${SLIC3R_BUILD_ID}-PR${PR_ID}
fi fi
file=$1 file=$1