Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bitbucket pipeline for Android Firebase App Distribution
image: bitbucketpipelines/android-ci-image
pipelines:
tags:
firebase-*:
- step:
name: Setup & Deploy
image: java:8 #remove this line if plugin "com.starter.easylauncher" isn't used
caches:
- android-sdk
- gradle
size: 2x
script:
- wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
- unzip -o -qq android-sdk.zip -d android-sdk
- export ANDROID_HOME="/opt/atlassian/pipelines/agent/build/android-sdk"
- export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH"
- yes | sdkmanager --licenses
- export ANDROID_SDK_ROOT=$ANDROID_HOME
- export FIREBASE_TOKEN=$FIREBASE_REFRESH_TOKEN
- echo $KEYSTORE_B64 | base64 -d > release.keystore
- echo "keystorePath=/opt/atlassian/pipelines/agent/build/release.keystore" > signing.properties
- echo "keystorePassword=$KEYSTORE_PWD" >> signing.properties
- echo "keyAlias=$KEY_ALIAS" >> signing.properties
- echo "keyPassword=$KEY_PWD" >> signing.properties
- chmod +x ./gradlew
- ./gradlew --stop #Only needed for environment variable changes
- ./gradlew assembleDevRelease appDistributionUploadDevRelease --stacktrace
- ./gradlew assembleQaRelease appDistributionUploadQaRelease --stacktrace
- ./gradlew assembleProdRelease appDistributionUploadProdRelease --stacktrace
# artifacts:
# - app/build/outputs/**
definitions:
caches:
android-sdk: /opt/atlassian/pipelines/agent/build/android-sdk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment