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?
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.