forked from kigen/bitbucket-pipelines-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitbucket-pipelines-slack.yml
20 lines (19 loc) · 1.38 KB
/
bitbucket-pipelines-slack.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
image: uber/android-build-environment:latest
pipelines:
default:
- step:
script:
# Grab the Android Support Repo which isn't included in the container
- echo y | android update sdk --filter "extra-android-m2repository" --no-ui -a
- mkdir "${ANDROID_HOME}/licenses" || true
- echo "8933bad161af4178b1185d1a37fbf41ea5269c55" > "${ANDROID_HOME}/licenses/android-sdk-license"
- echo "d56f5187479451eabf01fb78af6dfcb131a6481e" >> "${ANDROID_HOME}/licenses/android-sdk-license"
- ./gradlew assembleDebug
- . ./setup_export.sh
########## UPLOAD APK TO SLACK #CHANNEL ##########
# Setup the following enviroment variables on bitbucket pipelines &
# SLACK_TOKEN - Obtain this token from: https://api.slack.com/custom-integrations/legacy-tokens
# SLACK_CHANNEL - Channel name to upload the file.
- curl -F file=@"./app/build/outputs/apk/$FILE_NAME" -F channels=${SLACK_CHANNEL} -F token=${SLACK_TOKEN} https://slack.com/api/files.upload
########## UPLOAD A CHANGELOG POST TO SLACK #CHANNEL ##########
- curl -F content="---Uploaded by bitbucket pipelines, Pending manual edit---" -F filetype=post -F title="$FILE_TITLE CHANGELOG $BUILD_DATE" -F channels=${SLACK_CHANNEL} -F token=${SLACK_TOKEN} https://slack.com/api/files.upload