Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can I upload adk into the Bitbucket Downloads using Bitbucket Pipeline?

I am developing an android app and it is managed on the Bitbucket. I tried to use the "Pipeline" feature of the Bitbucket.

I found some references for it.

My first step is very simple. I just want to build "APK" file and upload it into the Bitbucket Downloads

I generated the config file like below:

image: mingc/android-build-box:latest
pipelines:
  default:
    - step:        script:
          - chmod +x gradlew
          - ./gradlew assembleDebug
          - curl -X POST --user ${BB_AUTH_STRING} "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"./app/build/outputs/apk/debug/*.apk"

When I run this Pipeline, Build is successful. But the APK file is not uploaded into the "Downloads" of Bitbucket.

The error log is very simple:

+ curl -X POST --user "${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"./app/build/outputs/apk/debug/*.apk"
Warning: setting file ./app/build/outputs/apk/debug/*.apk  failed!

What's wrong? What should I do?

1 answer

1 vote

Hi @yoonhok ,

you can use bitbucket-upload-file  pipe for that.

Just follow Deploy build artifacts to Bitbucket Downloads guide .

Configure your Bitbucket Pipelines with steps build and upload:

# Add this steps to your bitbucket-pipelines.yml file

- step:
name: Build Android APK
script:
- # your build command
artifacts:
- './app/build/outputs/apk/debug/your-awesome.apk'

- step:
name: Upload to Bitbucket Downloads
script
: - pipe: atlassian/bitbucket-upload-file:0.1.2 variables: BITBUCKET_USERNAME: $BITBUCKET_USERNAME BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD FILENAME: './app/build/outputs/apk/debug/your-awesome.apk' ACCOUNT: 'your-account' REPOSITORY: 'awesome-repository-name'

Please, feel free to share your pipes experience with us.

Cheers,
Alex

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,215 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you