Getting code-push build folder path

I am using react-native with code-push and everything is working fine.

Now I added Sentry Crash Report SDK to my project and I need to upload the main and sourcemap bundles to sentry. These file are generated in a build/temp folder like /var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/CodePush

The question is how would I get this folder path in the bitrise.yml file, I didn’t find any bitrise env variable that holds the path. During xcode-archive step BITRISE_XCARCHIVE_PATH point to a sub folder of the same build / temp path, But this variable is only available if xcode-archive step is involved. My workflow runs xcode-archive step during native code changes and the step is skipped for JavaScript only changes.

xcode-archive step is invoking xcodebuild with following archivepath:
"-archivePath" "/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/__archive__788672168/RepleteHealthMobile.xcarchive"

I need this path "/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T" irrespective of xcode-archive step

1 Like

I was able to provide bundle output directory path for code_push. which solved my current issue.

1 Like

Hi @ramki1979! :wave:

That’s a random path generated in that step, you’re free to pass any path to xcodebuild through the -archivePath parameter.

Do you run the xcodebuild command manually / from a Script or something? Is there a reason why you don’t use the Xcode Archive step there too?

Generated by which tool / what command?

Checking the path and that you said the archive was also generated there, I’d say maybe the dir is the $BITRISE_DEPLOY_DIR, but without your configs that’s just an educated guess :slight_smile:

I am running this step using xcode-archive@2.0.5
My Git commit decides whether Full Native Build is required or not [quote]xcode-archive step runs or not[/quote] .
Code_Push updates modified JS bundle OTA without updating the whole app. so if we modify only JS code then why wasting CPU and other things related to native build.

Its not $BITRISE_DEPLOY_DIR. As you said it’s random path the path applies throughout the workflow not just xcode_archive.

By providing JS bundle output path to code_push cli command I don’t require the random path anymore and my issue is solved.

Thanks you.

1 Like

The BITRISE_DEPLOY_DIR can be a random path if it’s not set before the CLI starts, but you’re right it’s never random on bitrise.io (for some reason I thought it is random on the Mac stacks).

Good catch and happy to hear! :wink: