devops: fix upload to work in mingw

This commit is contained in:
Dmitry Gozman 2019-11-22 17:16:47 -08:00
Родитель 3190044c00
Коммит d2ba399946
2 изменённых файлов: 14 добавлений и 3 удалений

Просмотреть файл

@ -30,7 +30,12 @@ else
exit 1
fi
ZIP_PATH="/tmp/archive-$BROWSER_NAME.zip"
if [[ $(uname) == MINGW* ]]; then
ZIP_PATH="$PWD/archive-$BROWSER_NAME.zip"
else
ZIP_PATH="/tmp/archive-$BROWSER_NAME.zip"
fi
if [[ -f $ZIP_PATH ]]; then
echo "Archive $ZIP_PATH already exists - remove and re-run the script."
exit 1

Просмотреть файл

@ -89,8 +89,14 @@ if ! [[ $ZIP_PATH == *.zip ]]; then
echo "ERROR: $ZIP_PATH is not a zip archive (must have a .zip extension)"
exit 1
fi
az storage blob upload -c builds --account-key $AZ_ACCOUNT_KEY --account-name $AZ_ACCOUNT_NAME -f $ZIP_PATH -n "$BLOB_PATH"
if [[ $(uname) == MINGW* ]]; then
WIN_PATH=$({ cd $(dirname $ZIP_PATH) && pwd -W; } | sed 's|/|\\|g')
WIN_PATH="${WIN_PATH}\\$(basename $ZIP_PATH)"
echo $WIN_PATH
az storage blob upload -c builds --account-key $AZ_ACCOUNT_KEY --account-name $AZ_ACCOUNT_NAME -f $WIN_PATH -n $BLOB_PATH
else
az storage blob upload -c builds --account-key $AZ_ACCOUNT_KEY --account-name $AZ_ACCOUNT_NAME -f $ZIP_PATH -n "$BLOB_PATH"
fi
echo "UPLOAD SUCCESSFUL!"
echo "-- SRC: $ZIP_PATH"