Forums

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

Artefacts not working anymore with .net7

Daniel Keeley June 20, 2023

I have a pipeline that publishes a .net core project and makes it an artefact which then the next step zips it and sends the zip to the server.

It works with .net5 but now .net7 is slightly different, it has to use -property:PublishDir=/published/ instead of -o (output) which I'm guessing is the cause of the issue.

image.png

If I check the folder with dir, it is correct, it has the files in:

image.png

Yet the artefacts tab says "No artifacts uploaded".

So on my next step it shows no files:

image.png

1 answer

1 accepted

1 vote
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 21, 2023

Hi Daniel,

When you run a Pipelines build, a Docker container will start for every step of your pipeline. The repo will get cloned in the path /opt/atlassian/pipelines/agent/build (this is exposed in the variable $BITBUCKET_CLONE_DIR) which is the present working directory when the first command from your step's script gets executed. When the step finishes, the container gets destroyed.

Only files in the BITBUCKET_CLONE_DIR can be defined as artifacts. The paths in the artifacts definition need to be relative to the clone directory.

With the artifact definition you have, the pipeline is going to look for a directory named published inside the BITBUCKET_CLONE_DIR. However, it looks like your artifacts may be generated inside /published instead. This is a directory named published at the root of the container, and not inside the BITBUCKET_CLONE_DIR.

Can you try removing the forward slash from -property:PublishDir=/published/, so change it to

-property:PublishDir=published/

and see if the artifacts get generated afterwards?

If the property needs an absolute path, you can use 

-property:PublishDir=$BITBUCKET_CLONE_DIR/published/

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events