CI/CD automation with CodePush and Bitrise Steps

We’re excited to introduce Revopush Bitrise Steps, making it simple to build and release React Native bundles in your workflow. With these steps, you can automate your deployment process (and not only!) directly in your CI/CD pipeline. In this article, we’ll walk you through how to set them up and get started.

Prerequisites

Before you start, make sure you have the following:

How to configure the Bitrise Step

  • Login to Revopush UI and add a new access key (Settings -> Add new key).
  • Give meaningful name to the key (eg BITRISE_REVOPUSH_ACCESS_KEY ) to never revoke it by mistake.
  • Default value of access key TTL (time to live) is set to 60 days, and you can set it to any value you want. Also keep in mind that in CLI users can extend the TTL of the key by name:

    $ revopush access-key patch "BITRISE_REVOPUSH_ACCESS_KEY" --ttl 128d

  • Login to Bitrise, select your project and go to Workflows -> Secrets.
  • Add Project level Secrets with the name REVOPUSH_ACCESS_KEY and value of Revopush token created before. See and example below: logo
  • Go to your Bitrise app Workflow Editor -> Configuration YAML and all commands you wish to execute with Revopush CLI in your workflow. Below is an example of release-react command for Android and iOS platforms for the Staging deployment:
    
    - git::[email protected]:revopush/revopush-bitrise-step.git@main:
      inputs:
      - command: release-react ios_app ios -d Staging
      - access_key: "$REVOPUSH_ACCESS_KEY"
      title: Releases the React Native iOS project / Staging
    - git::[email protected]:revopush/revopush-bitrise-step.git@main:
      inputs:
      - command: release-react ios_app ios -d Staging
      - access_key: "$REVOPUSH_ACCESS_KEY"
      title: Releases the React Native Android project / Staging
                                 
    The only mandatory inputs for Revopush Bitrise step are command and access_key.
  • The same step in UI looks like this: logo
    Having said that all the power of Revopush CLI commands including release-react, rollback, promote, patch and others can be a part of your Bitrise workflow!
  • Run your workflow and enjoy the power of Revopush CLI commands in your CI/CD pipeline!
    An example of the successful release of React Native bundle to the Staging deployment in Bitrise logs is shown below:
    
    + '[' '!' -z /Users/vagrant/git ']'
    + echo '==> switching to react native project root: /Users/vagrant/git'
    ==> switching to react native project root: /Users/vagrant/git
    + cd /Users/vagrant/git
    + '[' 0 -ne 0 ']'
    + which revopush
    + echo 'Installing Revopush CLI...'
    Installing Revopush CLI...
    + '[' '!' -z 0.0.3 ']'
    + npm install -g @revopush/[email protected] --silent
    + echo 'Logging in to Revopush...'
    Logging in to Revopush...
    + revopush logout
    + true
    + revopush login --accessKey [REDACTED]
    
    Successfully logged-in. Your session file was written to /Users/vagrant/.revopush.config. You can run the code-push logout command at any time to delete this file and terminate your session.
    
    + echo 'Execute command...'
    Execute command...
    + revopush release-react ios_app ios -d Staging
    Detecting ios app version:
    
    Using the target binary version value "1.0" from "ios/guineapig.xcodeproj/project.pbxproj".
    
    Running "react-native bundle" command:
    
    node node_modules/react-native/cli.js bundle --assets-dest /var/folders/b8/9zt_tx3s1y37nzh_cs991xyc0000gn/T/CodePush --bundle-output /var/folders/b8/9zt_tx3s1y37nzh_cs991xyc0000gn/T/CodePush/main.jsbundle --dev false --entry-file index.js --platform ios
    Welcome to Metro v0.81.1
    Fast - Scalable - Integrated
    
    Writing bundle output to: /var/folders/b8/9zt_tx3s1y37nzh_cs991xyc0000gn/T/CodePush/main.jsbundle
    Done writing bundle output
    Copying 1 asset files
    Done copying assets
    private key was not provided
    
    Releasing update contents to CodePush:
    
    
    Successfully released an update containing the "/var/folders/b8/9zt_tx3s1y37nzh_cs991xyc0000gn/T/CodePush" directory to the "Staging" deployment of the "ios_app" app.
    + echo 'Logging out from Revopush...'
    Logging out from Revopush...
    + revopush logout
    + exit 0
                                 

Additional resources

For any questions, please contact our support team. Give it a try and share your thoughts with us!

Join Revopush!

Avoid last-minute headaches!