Last active
May 10, 2020 18:27
-
-
Save albka1986/f1c6bdca1823e8d7a894f1c47bc3819a to your computer and use it in GitHub Desktop.
Bitbucket Pipeline: Config file (Sample for Android Project )
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: openjdk:8 | |
pipelines: | |
default: | |
- step: | |
caches: | |
- gradle | |
- android-sdk | |
script: | |
# Download and unzip android sdk | |
- 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 | |
# Define Android Home and add PATHs | |
- export ANDROID_HOME="/opt/atlassian/pipelines/agent/build/android-sdk" | |
- export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH" | |
# Download packages. | |
- yes | sdkmanager "platform-tools" | |
- yes | sdkmanager "platforms;android-27" | |
- yes | sdkmanager "build-tools;27.0.3" | |
- yes | sdkmanager "extras;android;m2repository" | |
- yes | sdkmanager "extras;google;m2repository" | |
- yes | sdkmanager "extras;google;instantapps" | |
- yes | sdkmanager --licenses | |
# Build apk | |
- chmod a+x ./gradlew | |
- ./gradlew assembleDebug | |
artifacts: | |
- app/build/outputs/apk/debug/*.apk | |
- step: | |
script: | |
# Saving artifact | |
- curl -X POST "https://${BB_AUTH_STRING}@api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"app/build/outputs/apk/debug/app-debug.apk" | |
definitions: | |
caches: | |
android-sdk: android-sdk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment