Goal
I want to have a Bitbucket API endpoint that allows me get information about the created artifacts of a pipeline
Use-case
Pull Requests pipelines can create artifacts that are approved as-is. If this artifact is deployed on merge (branches: production), I'd expect this exact artifact to be deployed.
If this artifact is created through external dependencies, these dependencies can change between the Pull Request pipeline and the actual deploy-on-merge.
To not have unexpected changes, you would want to pull the exact artifact of the approved pipeline and use that to deploy.
This is the recommended strategy of Terraform using `-out plan` artifacts (see https://developer.hashicorp.com/terraform/tutorials/automation/automate-terraform?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS#terraform-plan-out-tfplan-input-false)
Recommended implementation
Can be split in two requests. One to get artifact information and one endpoint to actually (down)load the content.
Endpoint: https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/artifacts
Response body:
PaginatedObject: { values: Array<Artifact Object> { uuid: string step_uuid: string path: string file_size_byte: number created_on: string }}
Endpoint: https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/artifacts/{artifact_uuid}/content
This relates to your internal API: https://bitbucket.org/!api/internal/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/artifacts
Hi Sander,
Thank you for the detailed use case and suggestion. We have an existing feature request about this in our issue tracker:
The request has been closed and it is not in our roadmap at the moment, as it had a low number of votes and comments. However, I would suggest posting a comment there to express your interest, as our product managers continue to monitor even closed requests.
Kind regards,Theodora
Thank you for finding this issue.
A workaround might be to use Bitbucket Downloads, as shared in https://community.atlassian.com/t5/Bitbucket-questions/How-to-use-build-artifact-from-one-pipeline-into-another/qaq-p/2025317#M81669.
You are very welcome and you are right, I have added the workaround in the feature request.
If you need anything further, please feel free to reach out!
It looks like you're new here. Sign in or register to get started.