diff options
author | Thomas <thomas.b.huang@gmail.com> | 2018-10-31 20:55:25 +0800 |
---|---|---|
committer | Thomas <thomas.b.huang@gmail.com> | 2018-10-31 20:55:25 +0800 |
commit | 7531de14f9575e59b9d0a1b30cf0df46dbc4af67 (patch) | |
tree | d9268e89a9fd7e5c6bf3c7c82c195422d7ffa117 /development/sentry-publish.js | |
parent | 611a61b7bc576bb83a6b7851f26d00488fe060f2 (diff) | |
parent | ac079365e6b4cf8b19db127e6971fa694fa54fff (diff) | |
download | tangerine-wallet-browser-7531de14f9575e59b9d0a1b30cf0df46dbc4af67.tar tangerine-wallet-browser-7531de14f9575e59b9d0a1b30cf0df46dbc4af67.tar.gz tangerine-wallet-browser-7531de14f9575e59b9d0a1b30cf0df46dbc4af67.tar.bz2 tangerine-wallet-browser-7531de14f9575e59b9d0a1b30cf0df46dbc4af67.tar.lz tangerine-wallet-browser-7531de14f9575e59b9d0a1b30cf0df46dbc4af67.tar.xz tangerine-wallet-browser-7531de14f9575e59b9d0a1b30cf0df46dbc4af67.tar.zst tangerine-wallet-browser-7531de14f9575e59b9d0a1b30cf0df46dbc4af67.zip |
Merge branch 'develop' into reducers
Diffstat (limited to 'development/sentry-publish.js')
-rw-r--r-- | development/sentry-publish.js | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/development/sentry-publish.js b/development/sentry-publish.js index 7a6d55115..e14f3f176 100644 --- a/development/sentry-publish.js +++ b/development/sentry-publish.js @@ -14,21 +14,27 @@ async function start () { const versionAlreadyExists = await checkIfVersionExists() // abort if versions exists if (versionAlreadyExists) { - console.log(`Version "${VERSION}" already exists on Sentry, aborting sourcemap upload.`) - return + console.log(`Version "${VERSION}" already exists on Sentry, skipping version creation`) + } else { + // create sentry release + console.log(`creating Sentry release for "${VERSION}"...`) + await exec(`sentry-cli releases --org 'metamask' --project 'metamask' new ${VERSION}`) + console.log(`removing any existing files from Sentry release "${VERSION}"...`) + await exec(`sentry-cli releases --org 'metamask' --project 'metamask' files ${VERSION} delete --all`) } - // create sentry release - console.log(`creating Sentry release for "${VERSION}"...`) - await exec(`sentry-cli releases --org 'metamask' --project 'metamask' new ${VERSION}`) - console.log(`removing any existing files from Sentry release "${VERSION}"...`) - await exec(`sentry-cli releases --org 'metamask' --project 'metamask' files ${VERSION} delete --all`) - // upload sentry source and sourcemaps - console.log(`uploading source files Sentry release "${VERSION}"...`) - await exec(`for FILEPATH in ./dist/chrome/*.js; do [ -e $FILEPATH ] || continue; export FILE=\`basename $FILEPATH\` && echo uploading $FILE && sentry-cli releases --org 'metamask' --project 'metamask' files ${VERSION} upload $FILEPATH metamask/$FILE; done;`) - console.log(`uploading sourcemaps Sentry release "${VERSION}"...`) - await exec(`sentry-cli releases --org 'metamask' --project 'metamask' files ${VERSION} upload-sourcemaps ./dist/sourcemaps/ --url-prefix 'sourcemaps'`) - console.log('all done!') + // check if version has artifacts or not + const versionHasArtifacts = versionAlreadyExists && await checkIfVersionHasArtifacts() + if (!versionHasArtifacts) { + // upload sentry source and sourcemaps + console.log(`uploading source files Sentry release "${VERSION}"...`) + await exec(`for FILEPATH in ./dist/chrome/*.js; do [ -e $FILEPATH ] || continue; export FILE=\`basename $FILEPATH\` && echo uploading $FILE && sentry-cli releases --org 'metamask' --project 'metamask' files ${VERSION} upload $FILEPATH metamask/$FILE; done;`) + console.log(`uploading sourcemaps Sentry release "${VERSION}"...`) + await exec(`sentry-cli releases --org 'metamask' --project 'metamask' files ${VERSION} upload-sourcemaps ./dist/sourcemaps/ --url-prefix 'sourcemaps'`) + console.log('all done!') + } else { + console.log(`Version "${VERSION}" already has artifacts on Sentry, skipping sourcemap upload`) + } } async function checkIfAuthWorks () { @@ -45,6 +51,12 @@ async function checkIfVersionExists () { return versionAlreadyExists } +async function checkIfVersionHasArtifacts () { + const artifacts = await exec(`sentry-cli releases --org 'metamask' --project 'metamask' files ${VERSION} list`) + // When there's no artifacts, we get a response from the shell like this ['', ''] + return artifacts[0] && artifacts[0].length > 0 +} + async function doesNotFail (asyncFn) { try { await asyncFn() |