Support testing
This commit is contained in:
@@ -4,7 +4,12 @@ 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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -7,6 +7,13 @@ export PATH
|
||||
|
||||
ENABLE_UPLOAD=$1
|
||||
BITBUCKET_AUTH=$2
|
||||
BITBUCKET_TESTING=$3
|
||||
|
||||
if [ "$BITBUCKET_TESTING" = "1" ]; then
|
||||
REPOSITORY=repertory-testing
|
||||
else
|
||||
REPOSITORY=repertory-ui
|
||||
fi
|
||||
|
||||
PRIVATE_KEY=../../blockstorage_dev_private.pem
|
||||
PUBLIC_KEY=../blockstorage_dev_public.pem
|
||||
@@ -33,7 +40,8 @@ exit_script() {
|
||||
|
||||
upload_to_bitbucket() {
|
||||
SOURCE_FILE=$1
|
||||
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 || exit_script "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 || exit_script "Upload to Bitbucket failed: ${SOURCE_FILE}"
|
||||
}
|
||||
|
||||
chmod +x "bin/${JQ_EXEC}" || exit_script "chmod +x ${JQ_EXEC} failed"
|
||||
@@ -65,7 +73,7 @@ if npm run dist; then
|
||||
upload_to_bitbucket "${OUT_FILE}"
|
||||
upload_to_bitbucket "${OUT_FILE}.sha256"
|
||||
upload_to_bitbucket "${OUT_FILE}.sig"
|
||||
BITBUCKET_LOCATION=https://bitbucket.org/blockstorage/repertory-ui/downloads/${OUT_FILE}
|
||||
BITBUCKET_LOCATION=https://bitbucket.org/blockstorage/${REPOSITORY}/downloads/${OUT_FILE}
|
||||
|
||||
cp -f ../releases.json ./releases.json
|
||||
for DISTRONAME in ${DISTRO_LIST}; do
|
||||
|
||||
Reference in New Issue
Block a user