Migrating from v2 to v3
Version 3 removes the hard coupling to Bitrise-specific environment variables. All actions now read from generic environment variables, making the plugin CI platform agnostic.
Environment variable changes
build_apk_or_aab
| v2 (Bitrise) | v3 |
|---|---|
BITRISE_GIT_COMMIT_HASH |
GIT_COMMIT_HASH |
BITRISE_SIGNING_KEY_DOWNLOAD_PATH |
ANDROID_KEYSTORE_PATH |
BITRISEIO_ANDROID_KEYSTORE_PASSWORD |
ANDROID_KEYSTORE_PASSWORD |
BITRISEIO_ANDROID_KEY_ALIAS |
ANDROID_KEY_ALIAS |
BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD |
ANDROID_KEY_PASSWORD |
BITRISE_DEPLOY_DIR |
DEPLOY_DIR |
build_ipa
| v2 (Bitrise) | v3 |
|---|---|
BITRISE_DEPLOY_DIR |
DEPLOY_DIR |
generate_release_notes
| v2 (Bitrise) | v3 |
|---|---|
GIT_CLONE_COMMIT_HASH |
GIT_COMMIT_HASH |
BITRISE_BUILD_NUMBER |
BUILD_NUMBER |
BITRISE_BUILD_URL |
BUILD_URL |
BITRISE_DEPLOY_DIR |
DEPLOY_DIR |
Note: GIT_CLONE_COMMIT_HASH was previously auto-set by Bitrise's git-clone step. On other CI platforms, set GIT_COMMIT_HASH to the commit SHA being built.
Migration options
Option 1: Set the new environment variables in your CI platform
Map whatever your CI platform provides to the new names. In your CI pipeline configuration, set the following environment variables from your platform's built-in values and secrets:
| Variable | What to map it to |
|---|---|
DEPLOY_DIR |
Your platform's artifact output directory |
BUILD_NUMBER |
Your platform's build/run number |
BUILD_URL |
Your platform's URL for the current build |
GIT_COMMIT_HASH |
The SHA of the commit being built |
ANDROID_KEYSTORE_PATH |
Path to the downloaded keystore file |
ANDROID_KEYSTORE_PASSWORD |
Keystore password (from secrets) |
ANDROID_KEY_ALIAS |
Key alias (from secrets) |
ANDROID_KEY_PASSWORD |
Key password (from secrets) |
Option 2: Pass values explicitly in your Fastfile
Every env var backed parameter can be passed directly to the action, taking precedence over any environment variable. This is the most portable and explicit approach:
build_apk_or_aab(
gradle_command: "android:bundleQaRelease",
version: lane_context[:version_name],
build_number: lane_context[:version_code],
output_directory: "/path/to/output",
keystore_path: ENV["MY_PLATFORM_KEYSTORE_PATH"],
keystore_password: ENV["MY_PLATFORM_KEYSTORE_PASSWORD"],
keystore_alias: ENV["MY_PLATFORM_KEYSTORE_ALIAS"],
key_password: ENV["MY_PLATFORM_KEY_PASSWORD"]
)
build_ipa(
version: version,
suffix: "UAT-App-Store",
output_directory: "/path/to/output",
scheme: "app",
export_method: "app-store",
configuration: "Release-UAT"
)
generate_release_notes(
release_notes_title: "MyApp",
oldest_ref: last_git_tag,
app_version: version,
commit_hash: ENV["MY_PLATFORM_COMMIT_SHA"],
ci_build_number: ENV["MY_PLATFORM_BUILD_NUMBER"],
ci_build_url: ENV["MY_PLATFORM_BUILD_URL"],
output_dir: "/path/to/output"
)