React Native — CD in Bitrise [Part II— iOS]

Hi again. In the last part, we have set up our RN project, iOS certs, and profiles and the fastlane deployment. Now we can use all of this in the Bitrise panel!

yes, you can’t, I know

Log in to your account and proceed with app creation:

1*zV5v0Ba3Rx43YLtTK0NyNw

Click Add New App and choose Add New App on web UI, then just proceed with app creation:

1*M1F84o7t8O2nz3Ypn bsow

You might find help in this video.

Okay, you have an app. Now we can go to the workflow. You can delete all steps there except Activate SSH key (RSA private key) and Git Clone Repository 🙂 . Let’s add 3 steps:

  1. Run yarn command (in which you execute yarn install)

  2. Certificate and profile installer (to install our certs and profiles, we will upload them later)

  3. fastlane(to run our deploy lane which we have prepared in part I)

fastlane step

Our workflow should look like:

1*GrCAYdVwD5ZZrLEdm7 -gw

Great, we have everything prepared. Now we can provide all the necessary data to make this actually works!

Firstly, we need to upload our certs and profiles. Go to Code Signing tab and upload our files which we have generated in part I.

Green color means correct matching between uploaded profile and certificate. Otherwise, you will have an error and build won’t work

After that go to Secrets tab. Rememeber when we have genereted all necessary data in part I to handle connection? Now we will need it:

1*IZp86vqT9-ZpeUfG4yTvwQ

As you can see. Three variables: 

FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORDFASTLANE_SESSION and FASTLANE_PASSWORD are used to make proper authorization with Apple. Thanks to that we will be able to upload the build into Testflight.

  1. FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD — value generated under your apple account

  2. FASTLANE_SESSION — session generated with fastlane spaceauth -u

  3. FASTLANE_PASSWORD — password to your apple account

If you encounter some auth issues then regenerate the session with Apple and replace value under FASTLANE_SESSION.

Okay! In this moment we have everything configured we can run a build and after some time:

1*3h6Yyd0jKtw8KcJDy7FM1w

It works! 🎉

1*GDPm2XIuMgWBNzxB6MBs-g

Of course we can have different issues related to bitrise. Bitrise is not free. To use it we need to subscribe to particular plan. I guess there is a free plan but it allows only for 30 minutes` pipelines. You might notice that this simple app has been building for 31 minutes and without paid plan my pipeline would have been aborted!

Great, now you have simple CD configured with Bitrise and Fastlane. I will extend this tutorial with next configs like react-native-config and Android deployment.

Cheers!

19.02.2021Marcin Sadowski

Matt Sadowski / CEO of Mobile Reality
Has this article been helpful? Are you interested in consulting your business initiative with us? We would be thrilled to support your tech and business efforts in order to create profitable digital products with you! Just contact us through the contact form or chat on our website our experts are always ready to advise you and help you create an effective mobile or/and web platform for business.

Check also

Free consultationShare reactionShare comment
Back to blog