I have a package that I don't need to publish it into PyPi because it is for internal use only, so I wrote this pipeline that automate testing and deployment as zip file. But I need to upload it into repo downloads:
image: python:3.10
pipelines:
branches:
master:
- step:
name: Test and Build
script:
- pip install -r requirements.txt
- pip install coverage
- python -m coverage run -m unittest discover -v -s .\tests\ -p '*_tests.py'
- python -m coverage report
- step:
name: Check coverage and build package
script:
- python -m coverage report --fail-under=95
- if [[ $? -eq 0 ]]; then python setup.py sdist --formats zip; fi
- if [[ -e dist/*.zip ]]; then echo "Zip file exists"; fi
artifacts:
- dist/*.zip
- step:
name: Deploy to repo downloads
script:
- pipe: atlassian/bitbucket-upload-file:0.5.0
variables:
FILENAME: dist/*.zip
It is failing to execute, I can't figure out what it is.
Thanks for your help.
Hey @Nelson Insignares and thank you for reaching out to Community!
From your description, I assume the error is happening on the pipe atlassian/bitbucket-upload-file
By looking at the yml file you shared, it seems the pipe definition is lacking the required variables for authentication. As this pipe will execute API calls under the hood, you need to provide the credentials for authentication. Currently, that particular pipe supports basic authentication or access tokens, as the following examples :
script:
- pipe: atlassian/bitbucket-upload-file:0.5.0
variables:
BITBUCKET_USERNAME: $BITBUCKET_USERNAME
BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
FILENAME: 'dist/*.zip'
script: - pipe: atlassian/bitbucket-upload-file:0.5.0 variables: BITBUCKET_ACCESS_TOKEN: $BITBUCKET_ACCESS_TOKEN FILENAME: 'dist/*.zip'
For more details and additional examples on the configuration of that pipe, you can refer to its official documentation below :
You can try using the suggestion above to include the authentication and let us know how it goes!
If you are still facing the error after those changes, please share with us what exact command/section is erroring out and which is the full error log, so we can assist you further.
Thank you, @Nelson Insignares !
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.