-
-
Save jQrgen/f09d5ba2da60fdf7d46ad6dec856f299 to your computer and use it in GitHub Desktop.
Android + Bitbucket Pipeline + Fabric Beta - bitbucket-pipelines.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: java:8 | |
pipelines: | |
branches: | |
test: | |
- step: | |
caches: | |
- gradle | |
- android-sdk | |
script: | |
- wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-4333796.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 "platform-tools" | |
- yes | sdkmanager "platforms;android-28" | |
- yes | sdkmanager "build-tools;28.0.2" | |
- yes | sdkmanager "extras;android;m2repository" | |
- yes | sdkmanager "extras;google;m2repository" | |
- yes | sdkmanager "extras;google;instantapps" | |
- yes | sdkmanager --licenses | |
- echo "Start" | |
# Testing gradle | |
- ./gradlew testDebugUnitTest | |
# Build apk and distribute | |
- chmod a+x ./gradlew | |
- ./gradlew assembleDebug crashlyticsUploadDistributionDebug | |
# Upload apk to bitbucket downloads for debug | |
- FILE_PATH=./app/build/outputs/apk/debug/app-debug.apk | |
- echo "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"${FILE_PATH}" | |
- curl -X POST --user "${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"${FILE_PATH}" | |
- echo "only test branch" | |
definitions: | |
caches: | |
android-sdk: android-sdk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment