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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.