通过电子邮件发送* .apk。 Bitbucket管道

时间:2018-06-01 06:54:31

标签: bitbucket bitbucket-pipelines bitbucket-api

如何将android apk发送到电子邮件? Bitbucket管道。我正在使用松弛做import { Directive, ElementRef, OnInit, } from '@angular/core'; @Directive({ // tslint:disable-next-line selector: '[data-v]' }) export class DataVandvDirective implements OnInit { vAttribute: string; constructor(private element: ElementRef) { const native = this.element.nativeElement; this.vAttribute = native.getAttribute('data-v'); console.log("the v att", this.vAttribute); } ngOnInit(): void { } }

bitbucket-pipelines.yml

1 个答案:

答案 0 :(得分:1)

按如下所示纠正文件。

- curl -F file=@"./app/build/outputs/apk/$FILE_NAME" -F channels=${SLACK_CHANNEL} -F token=${SLACK_TOKEN} https://slack.com/api/files.upload

完整的YML:

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

“ setup_export.sh”文件。

#!/usr/bin/env bash
LATEST_APK=$(ls -lrt ./app/build/outputs/apk/*.apk | tail -1 | awk -F" " '{ print $9 }') #Pick the latest build apk. 
FILE_NAME=$(basename $LATEST_APK .apk)".apk" 
BUILD_DATE=`date +%Y-%m-%d` #optional -- For changelog title. 
FILE_TITLE=$(basename $LATEST_APK .apk) #optional -- For changelog title. 

功劳归功于以下用户。

https://github.com/kigen/bitbucket-pipelines-android