allow sentry-cli to be installed globally

refs AE-162

Change-Id: I5c675d459fc1e19255c088b3c72fe6a5fe46ccbd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/316196
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
This commit is contained in:
Aaron Ogata 2023-04-17 13:43:16 -07:00
parent 8c70ee1323
commit 7a60851881
1 changed files with 3 additions and 1 deletions

View File

@ -107,8 +107,10 @@ unless $canvas_tasks_loaded
missing_args = %i[auth_token url org project version].select { |k| args[k].blank? } missing_args = %i[auth_token url org project version].select { |k| args[k].blank? }
raise "Arguments missing: #{missing_args}" unless missing_args.empty? raise "Arguments missing: #{missing_args}" unless missing_args.empty?
sentry_cli_path = (ENV["SENTRY_CLI_GLOBAL"] == "1") ? "sentry-cli" : "yarn run sentry-cli"
puts "--> Uploading source maps to Sentry at #{args.url}" puts "--> Uploading source maps to Sentry at #{args.url}"
system "SENTRY_AUTH_TOKEN=#{args.auth_token} SENTRY_URL=#{args.url} SENTRY_ORG=#{args.org} yarn run sentry-cli " \ system "SENTRY_AUTH_TOKEN=#{args.auth_token} SENTRY_URL=#{args.url} SENTRY_ORG=#{args.org} #{sentry_cli_path} " \
"releases --project #{args.project} files #{args.version} upload-sourcemaps public/dist/ --ignore-file " \ "releases --project #{args.project} files #{args.version} upload-sourcemaps public/dist/ --ignore-file " \
".sentryignore --url-prefix '~/dist/'" ".sentryignore --url-prefix '~/dist/'"
end end