Setting up the CodePush plugin
To use the CodePush CLI plugin, install the plugin with the Bitrise CLI. Optionally, you can set it up with a custom server URL.
Installing the CodePush CLI plugin
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 URL
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_URLEnvironment 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_URLenvironment variable -
The
server_urlfield in the.codepush.jsonfile. -
Default:
https://api.bitrise.io