Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace AppCenter with CodePushStandalone commands #12349

Merged
merged 4 commits into from
Jan 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions docs/platforms/react-native/sourcemaps/uploading/codepush.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,41 @@ export default codePush(Sentry.wrap(App));

To ensure Sentry can symbolicate events from your CodePush releases, you need to generate and upload the necessary assets. When creating a CodePush release, include the `--sourcemap-output-dir` flag to generate source maps. This allows you to upload these files to Sentry in the next step.

```bash {tabTitle:JSC}
```bash {tabTitle:JSC (Standalone)}
code-push-standalone release-react \
krystofwoldrich marked this conversation as resolved.
Show resolved Hide resolved
"${APP_NAME}" \
"${PLATFORM}" \
--deploymentName "${DEPLOYMENT_NAME}" \
--outputDir ./build \
--sourcemapOutput ./build
```

```bash {tabTitle:Hermes (Standalone)}
rm -rf ./build
CODEPUSH_COMMAND="code-push-standalone release-react \
\"${APP_NAME}\" \
\"${PLATFORM}\" \
--deploymentName \"${DEPLOYMENT_NAME}\" \
--useHermes \
--outputDir ./build \
--sourcemapOutput ./build"

DEBUG_ID=$(eval "$CODEPUSH_COMMAND" | tee /dev/tty | grep -o 'Bundle Debug ID: [0-9a-f-]*' | sed 's/Bundle Debug ID: //')

MAP_FILE=$(find ./build -name "*.map" -type f)
jq -c ". + {\"debug_id\": \"${DEBUG_ID}\"}" "${MAP_FILE}" > "${MAP_FILE}.tmp"
mv "${MAP_FILE}.tmp" "${MAP_FILE}"
```

```bash {tabTitle:JSC (AppCenter)}
appcenter codepush release-react \
--app "${APP_NAME}" \
--deployment-name "${DEPLOYMENT_NAME}" \
--output-dir ./build \
--sourcemap-output-dir ./build
```

```bash {tabTitle:Hermes}
```bash {tabTitle:Hermes (AppCenter)}
rm -rf ./build
CODEPUSH_COMMAND="appcenter codepush release-react \
--app \"${APP_NAME}\" \
Expand All @@ -44,7 +70,6 @@ CODEPUSH_COMMAND="appcenter codepush release-react \

DEBUG_ID=$(eval "$CODEPUSH_COMMAND" | tee /dev/tty | grep -o 'Bundle Debug ID: [0-9a-f-]*' | sed 's/Bundle Debug ID: //')

# Find the .map file and add the debug_id to it
MAP_FILE=$(find ./build -name "*.map" -type f)
jq -c ". + {\"debug_id\": \"${DEBUG_ID}\"}" "${MAP_FILE}" > "${MAP_FILE}.tmp"
mv "${MAP_FILE}.tmp" "${MAP_FILE}"
Expand Down
Loading