Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to include artefacts outside of the build directory in pipelines

Richard Tingle
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 15, 2019

Background

I'm trying to grab some logs that are generated as part of some unit tests. They are generated within the directory

/root/OneMillionWorlds/errorLog

I tried having my bitbucket-pipelines.yml as follows:

image: openjdk:8
pipelines:
default:
- step:
script:
- set -e #set -e so longs are saved even if the build fails (which you obviously want)
- bash ./gradlew bitbucketTests
artifacts:
- readme.md #Included so I can tell if its grabbing artefacts at all, it is
- /root/OneMillionWorlds/errorLog/**


However that doesn't pull in the files in the errorLog folder, just the readme.md.

I've also tried climbing up from build, so:

- ../../../../../root/OneMillionWorlds/errorLog/** #I believe its relative to /opt/atlassian/pipelines/agent/build found because test classes found at /opt/atlassian/pipelines/agent/build/build/classes/java/test


That also seems not to work.

 

Question

How can I grab files outside the build folder as artefacts?

1 answer

1 accepted

0 votes
Answer accepted
StannousBaratheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 27, 2019

Hi @Richard Tingle 

Currently pipelines only supports artifacts relative to the build directory. This is due to implementation details related to what volumes are shared between your build container and the pipelines agent.

In order to capture artifacts outside of the build directory you must first copy them to a location under the build directory in your script and then reference the new location in the artifact definition.

Richard Tingle
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 28, 2019

Thanks, I've configured my application, when running tests to write its logs to within the build directory and I've been able to grab them that way

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events