pipeline creating with cross project dependences

VIVEK JAIN April 18, 2020

We have created a few projects (modules in terms of maven). when compiled they are dependent on other modules (projects in Jira with independent bitbucket repositories).

While the totally independent modules get compiled successfully, the modules which uses other modules/artifacts as dependencies get failed as they are not able to find the relevant dependencies. which considering the fact that the builds in bitbucket are executed in docker they are not persisted.

I tried using  $BITBUCKET_CLONE_DIR, but unfortunately not able to make any headway on how to use it, wherein we can refer these dependencies.

It would be great if somebody can point us to the right documentation and/or provide any help which can help us run these pipelines

1 answer

0 votes
Ronald C_
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 18, 2020

Hi @VIVEK JAIN

Hope you're doing well. :)

If I understand your request correctly, you would like the generated dependencies to be shared across different repositories.

One of the way that I can suggest is by uploading the dependencies to the Repository's "Download" page which the other build can download it directly.

This are a few steps you can follow to upload to the "Download" page

  1. Zip the dependencies that you want to share to other repos
  2. Use "Bitbucket Upload file" Pipe to upload the Download page  (Link to the Pipe)
    - pipe: atlassian/bitbucket-upload-file:0.1.4
      variables:
        BITBUCKET_USERNAME: '<string>'
        BITBUCKET_APP_PASSWORD: '<string>'
        FILENAME: '<string>'
        # ACCOUNT: '<string>' # Optional
        # REPOSITORY: '<string>' # Optional
        # DEBUG: '<boolean>' # Optional

Once the files is uploaded to the Download page, the other project that you have can run a simple curl command to download the file then unzip it:

curl "https://${BB_AUTH_STRING}@api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads/<YOUR_FILE_NAME>" --output "<YOUR_FILE_NAME>"

ℹ The value of the variable ${BB_AUTH_STRING} is your username and password (<username>:<password>)

Cheers,
Ronald

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events