-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
meta: extract and improve upload symbol script
- Loading branch information
1 parent
585b341
commit 5d5821d
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
|
||
if which sentry-cli >/dev/null; then | ||
if [ -f .env ] && grep -q "^SENTRY_ORG=" .env && grep -q "^SENTRY_PROJECT=" .env; then | ||
export $(grep -v '^#' .env | sed '/^\s*$/d' | xargs) | ||
else | ||
echo "[ERROR] .env does not exist or does not have SENTRY_ORG and SENTRY_PROJECT defined" | ||
exit 1 | ||
fi | ||
if [ ! -n "$SENTRY_AUTH_TOKEN" ]; then | ||
if [ -f ~/.sentryclirc ]; then | ||
export SENTRY_AUTH_TOKEN=$(grep -oE "token=([^\n\r]*)$" ~/.sentryclirc | cut -d'=' -f2) | ||
echo "Using SENTRY_AUTH_TOKEN from .sentryclirc." | ||
fi | ||
if [ -f ~/.zshrc ] && grep -q "export SENTRY_AUTH_TOKEN" ~/.zshrc; then | ||
grep -m 1 "export SENTRY_AUTH_TOKEN" ~/.zshrc > /tmp/ios.sentry-build.tmp && source /tmp/ios.sentry-build.tmp && rm /tmp/ios.sentry-build.tmp | ||
echo "Using SENTRY_AUTH_TOKEN from .zshrc." | ||
fi | ||
fi | ||
if [ ! -n "$SENTRY_AUTH_TOKEN" ]; then | ||
echo "[ERROR] must provide SENTRY_AUTH_TOKEN either through command line, .zshrc or .sentryclirc" | ||
exit 1 | ||
fi | ||
|
||
ERROR=$(sentry-cli upload-dif --include-sources "$DWARF_DSYM_FOLDER_PATH" 2>&1 >/dev/null) | ||
if [ ! $? -eq 0 ]; then | ||
echo "warning: sentry-cli - $ERROR" | ||
fi | ||
else | ||
echo "[ERROR] sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases" | ||
exit 1 | ||
fi |