Skip to content
Pranit Harekar edited this page May 31, 2020 · 4 revisions

Fastlane CodePush plugin

This is a Fastlane plugin for App Center CodePush service

Prerequisites

Install the App Center CLI

npm install -g appcenter-cli

Getting Started

This is a fastlane plugin. To get started with fastlane-plugin-codepush, add it to your project by running:

fastlane add_plugin codepush

List of available actions

1. codepush_login

Log in to App Center to access CodePush service.

codepush_login
Option Description Environment Variable Default
login_token App center login token to access CodePush service, optional if ENV['APP_CENTER_LOGIN_TOKEN'] is set APP_CENTER_LOGIN_TOKEN
enforce Enforce logout before login false

2. codepush_logout

Log out of App Center

codepush_logout

3. codepush_release_react

CodePush release-react action

This action lets you release React Native Javascript bundles to a specific CodePush deployment.

codepush_release_react(
    app_name: "pharekar/MyAwesomeApp",
    disable_duplicate_release_error: true
)
Option Description Environment Variable Default
app_name Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set APP_CENTER_APP_NAME
execution_dir_path Release React CLI command execution dir path ./
target_binary_version Store/binary version of the app you are releasing the update for "*"
deployment_name Name of your deployment Staging
output_dir Output directory
sourcemap_output Relative path to where the generated JS bundle's source map file should be written
plist_file_prefix File name prefix of the Info.plist file
plist_file (iOS) Relative path to the Info.plist file
gradle_file (Android) Relative path to the build.gradle file
description An optional change log for the deployment
mandatory Specify whether the update should be considered mandatory or not false
disabled Specify whether the update should be downloadable by end users or not false
rollout_percentage Percentage of users that should be eligible to receive this update
disable_duplicate_release_error Specify whether duplicate release error should be disabled or not false
disable_telemetry Specify whether telemetry should be disabled or not false
version Version
private_key_path Relative path to private key
entry_file Relative path to the app's root/entry JavaScript file
development Specify whether to generate an unminified, development JS bundle
bundle_name File name that should be used for the generated JS bundle
dry_run Print the command that would be run, and don't run it false

4. codepush_promote

CodePush promote deployment action

This action lets you promote updates from a source deployment to a destination deployment.

codepush_promote(
    app_name: "pharekar/MyAwesomeApp",
    source_deployment_name: "Staging",
    destination_deployment_name: "Production",
)
Option Description Environment Variable Default
app_name Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set APP_CENTER_APP_NAME
execution_dir_path Promote CLI command execution dir path ./
target_binary_version Store/binary version of the app you are releasing the update for "*"
source_deployment_name Source deployment name
destination_deployment_name Destination deployment name
description An optional change log for the deployment
rollout_percentage Percentage of users that should be eligible to receive this update
disable_duplicate_release_error Specify whether duplicate release error should be disabled or not false
disable_telemetry Specify whether telemetry should be disabled or not false
dry_run Print the command that would be run, and don't run it false

5. codepush_add_deployment

CodePush add deployment action

This action lets you add new CodePush deployment.

codepush_add_deployment(
  app_name: "pharekar/MyAwesomeApp",
  deployment_name: "Alpha"
)
Option Description Environment Variable Default
app_name Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set APP_CENTER_APP_NAME
execution_dir_path Release React CLI command execution dir path ./
deployment_name Deployment name
dry_run Print the command that would be run, and don't run it false

6. codepush_remove_deployment

CodePush remove deployment action

This action lets you remove CodePush deployment.

codepush_remove_deployment(
  app_name: "pharekar/MyAwesomeApp",
  deployment_name: "Alpha"
)
Option Description Environment Variable Default
app_name Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set APP_CENTER_APP_NAME
execution_dir_path Release React CLI command execution dir path ./
deployment_name Deployment name
dry_run Print the command that would be run, and don't run it false

7. codepush_rename_deployment

CodePush rename deployment action

This action lets you rename CodePush deployment.

codepush_rename_deployment(
  app_name: "pharekar/MyAwesomeApp",
  deployment_name: "Alpha",
  new_deployment_name: "Internal-Alpha"
)
Option Description Environment Variable Default
app_name Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set APP_CENTER_APP_NAME
execution_dir_path Release React CLI command execution dir path ./
deployment_name Deployment name
new_deployment_name New deployment name
dry_run Print the command that would be run, and don't run it false

8. codepush_list_deployment

CodePush list deployment action

This action lets you list all CodePush deployment.

codepush_list_deployment(
  app_name: "pharekar/MyAwesomeApp"
)
Option Description Environment Variable Default
app_name Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set APP_CENTER_APP_NAME
execution_dir_path Release React CLI command execution dir path ./
dry_run Print the command that would be run, and don't run it false

9. codepush_exists_deployment

This action lets check if given CodePush deployment exists. Returns boolean value.

codepush_exists_deployment(
  app_name: "pharekar/MyAwesomeApp",
  deployment_name: "Alpha"
)

## returns true if 'Alpha' deployment exists otherwise false
Option Description Environment Variable Default
app_name Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set APP_CENTER_APP_NAME
execution_dir_path Release React CLI command execution dir path ./
deployment_name Deployment name
dry_run Print the command that would be run, and don't run it false

10. codepush_get_deployment_key

This action returns CodePush deployment key given deployment name. If deployment does not exists it returns nil

codepush_get_deployment_key(
  app_name: "pharekar/MyAwesomeApp",
  deployment_name: "Alpha"
)

## 1243453jksau2113l2h1k323h1829ebj

codepush_get_deployment_key(
  app_name: "pharekar/MyAwesomeApp",
  deployment_name: "foo"
)

## nil
Option Description Environment Variable Default
app_name Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set APP_CENTER_APP_NAME
execution_dir_path Release React CLI command execution dir path ./
deployment_name Deployment name
dry_run Print the command that would be run, and don't run it false

Example

Check out the example Fastfile to see how to use this plugin.