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

Uploading pipeline artifacts to OneDrive

Phil Brandvold February 3, 2022

So we have a build pipeline that builds a Linux kernel, and we use Microsoft Teams for project files. The artifact we end up with is 1.3GB, which is over the 1GB limit to be available in the pipeline GUI. We'd like to put the file into the Teams folder the project team is using, which leverages OneDrive on the backend. Has anyone had luck getting files from Bitbucket over to OneDrive? Or even uploading files from a linux container or build server to OneDrive programmatically?

1 answer

0 votes
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 23, 2022

Hey Phil!

Whilst Bitbucket Cloud does not formally support OneDrive, and providing assistance with scripting is outside of our support scope, here are some possible things that you can try:

  • To copy and zip the files you require, I would suggest installing/making use of the CURL/Zip packages within your yml configuration.
  • Once this is installed, create a directory to store your files, move the files to this directory using the cp command to copy and zip command to compress the folder.
  • I would then suggest checking out the OneDrive API documentation to prepare a cURL script to upload the resulting zipped directory to the location you require:
    https://docs.microsoft.com/en-us/onedrive/developer/rest-api/concepts/upload?view=odsp-graph-online
  • Example:
pipelines: 
default:
-
step:
script:
-
apt-get update
-
apt-get -qq install zip curl
- mkdir $FOLDERNAME
- cp folderpath/filepath.extension $FOLDERNAME/
- zip -r $FOLDERNAME.zip $FOLDERNAME/
- curl INSERTAPICOMMANDHERE

Hope this helps to steer you in the right direction.

Cheers!

- Ben (Bitbucket Cloud Support

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events