Support testing

This commit is contained in:
2020-06-18 16:13:39 -05:00
parent 4c5e364a3d
commit 8e2c42402b
2 changed files with 24 additions and 11 deletions

View File

@@ -1,10 +1,15 @@
@echo off
@echo off
setlocal EnableDelayedExpansion
set ROOT=%~dp0%
set /a ENABLE_UPLOAD=%1
set BITBUCKET_AUTH=%2
set BITBUCKET_TESTING=%3
if "%BITBUCKET_TESTING%" == "1" (
set REPOSITORY=repertory-testing
) else (
set REPOSITORY=repertory-ui
)
set OPENSSL_BIN="c:\OpenSSL-Win64\bin\openssl.exe"
if NOT EXIST %OPENSSL_BIN% (
set OPENSSL_BIN="c:\Program Files\OpenSSL-Win64\bin\openssl.exe"
@@ -50,7 +55,7 @@ pushd "%ROOT%"
call :UPLOAD_TO_BITBUCKET "%OUT_FILE%"
call :UPLOAD_TO_BITBUCKET "%OUT_FILE%.sha256"
call :UPLOAD_TO_BITBUCKET "%OUT_FILE%.sig"
set BITBUCKET_LOCATION=https://bitbucket.org/blockstorage/repertory-ui/downloads/%OUT_FILE%
set BITBUCKET_LOCATION=https://bitbucket.org/blockstorage/%REPOSITORY%/downloads/%OUT_FILE%
del /q releases.json 1>NUL 2>&1
@@ -65,10 +70,10 @@ pushd "%ROOT%"
)
popd
goto :END
:NO_QUOTES
set %~1=!%~1:"=!
goto :EOF
goto :EOF
:PIXEL_RESPONSE
set PIXEL_RESPONSE=
@@ -98,8 +103,8 @@ goto :EOF
set SOURCE_FILE=%1
call :NO_QUOTES SOURCE_FILE
call :NO_QUOTES BITBUCKET_AUTH
echo "Uploading !SOURCE_FILE! to Bitbucket"
(curl --fail -u "!BITBUCKET_AUTH!" -X POST https://api.bitbucket.org/2.0/repositories/blockstorage/repertory-ui/downloads -F files="@!SOURCE_FILE!" > upload_response.json) || (call :ERROR "Upload to Bitbucket failed: %SOURCE_FILE%")
echo "Uploading !SOURCE_FILE! to Bitbucket %REPOSITORY%"
(curl --fail -u "!BITBUCKET_AUTH!" -X POST https://api.bitbucket.org/2.0/repositories/blockstorage/%REPOSITORY%/downloads -F files="@!SOURCE_FILE!" > upload_response.json) || (call :ERROR "Upload to Bitbucket %REPOSITORY% failed: %SOURCE_FILE%")
goto :EOF
:ERROR
@@ -108,9 +113,9 @@ goto :EOF
if "%DISABLE_PAUSE%" NEQ "1" (
pause
)
goto :END
goto :END
:END
if "!ERROR_EXIT!" NEQ "0" (
exit !ERROR_EXIT!
)
)