Setting up the CodePush plugin
Installing the CodePush CLI pluginClick to copy link
Install the CodePush CLI plugin so that you can use CodePush locally, on your own machines.
-
Run the following command:
bitrise plugin install --source https://github.com/bitrise-io/bitrise-plugins-codepush-cli.git -
Run the plugin:
bitrise :codepush
Setting a custom server URLClick to copy link
Set a different target environment for CodePush instead of the main Bitrise server. For example, you can set a staging environment as the base server URL.
There are three ways to do so:
-
Use the
pushcommand with the--server-urlflag:bitrise :codepush push --server-url https://api.staging.bitrise.io -
Export the $CODEPUSH_SERVER_URL Environment Variable:
export CODEPUSH_SERVER_URL=https://api.staging.bitrise.io -
Set the server URL during initializing with the
initcommand. This writes the URL into the.codepush.jsonfile:bitrise :codepush init --server-url https://api.staging.bitrise.io
The server URL is resolved in the following order:
- The
--server-urlflag (highest priority) - The CODEPUSH_SERVER_URL environment variable
- The
server_urlfield in the.codepush.jsonfile. - Default: https://api.bitrise.io