I have been trying to build and publish a project using bitbucket pipelines and when its done I'm saving the published folder as an artifact in my pipeline but it isn't being saved.
Following is my pipeline:
image: mcr.microsoft.com/dotnet/core/sdk:3.1
pipelines: branches: staging: - step: name: Build and Test caches: - dotnetcore script: - cd Tracs4Life - dotnet restore - dotnet build --no-restore --configuration Release - dotnet publish --configuration Release --no-build ./Tracs4Life.Website/Tracs4Life.Website.csproj -o ./publish - ls artifacts: - publish/**
Here are the logs:
<span>+ cd Tracs4Life</span>
<span> Determining projects to restore...</span><span> Restored /opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Admin/Tracs4Life.Admin.csproj (in 442 ms).</span><span> Restored /opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Model/Tracs4Life.Model.csproj (in 499 ms).</span><span> Restored /opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Service/Tracs4Life.Service.csproj (in 523 ms).</span><span> Restored /opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Common/Tracs4Life.Common.csproj (in 134 ms).</span><span> Restored /opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Website/Tracs4Life.Website.csproj (in 586 ms).</span><span> Restored /opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Interface/Tracs4Life.Interface.csproj (in 131 ms).</span><span> Restored /opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Repository/Tracs4Life.Repository.csproj (in 154 ms).<br><br></span><span>+ dotnet restore</span>
<span>Microsoft (R) Build Engine version 16.7.2+b60ddb6f4 for .NET</span><span>Copyright (C) Microsoft Corporation. All rights reserved.</span><span> Tracs4Life.Admin -> /opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Admin/bin/Release/netcoreapp3.1/Tracs4Life.Admin.dll</span><span> Tracs4Life.Admin -> /opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Admin/bin/Release/netcoreapp3.1/Tracs4Life.Admin.Views.dll</span><span>Domain/TrainingTracs4LifeContext.cs(328,10): warning CS1030: #warning: 'To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see <a href="https://go.microsoft.com/fwlink/?linkid=2131148" target="_blank" rel="noopener nofollow noreferrer">https://go.microsoft.com/fwlink/?linkid=2131148</a>. For more guidance on storing connection strings, see <a href="http://go.microsoft.com/fwlink/?LinkId=723263.'" target="_blank" rel="noopener nofollow noreferrer">http://go.microsoft.com/fwlink/?LinkId=723263.'</a> [/opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Model/Tracs4Life.Model.csproj]</span><span> Tracs4Life.Model -> /opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Model/bin/Release/netcoreapp3.1/Tracs4Life.Model.dll</span><span> Tracs4Life.Interface -> /opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Interface/bin/Release/netcoreapp3.1/Tracs4Life.Interface.dll</span><span> Tracs4Life.Common -> /opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Common/bin/Release/netcoreapp3.1/Tracs4Life.Common.dll</span><span> Tracs4Life.Repository -> /opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Repository/bin/Release/netcoreapp3.1/Tracs4Life.Repository.dll</span><span>FacilityService.cs(21,46): warning CS0649: Field 'FacilityService._claimHelperService' is never assigned to, and will always have its default value null [/opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Service/Tracs4Life.Service.csproj]</span><span> Tracs4Life.Service -> /opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Service/bin/Release/netcoreapp3.1/Tracs4Life.Service.dll</span><span>Controllers/HomeController.cs(55,13): warning CS0162: Unreachable code detected [/opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Website/Tracs4Life.Website.csproj]</span><span> <a href="http://Tracs4Life.Website" target="_blank" rel="noopener nofollow noreferrer">Tracs4Life.Website</a> -> /opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Website/bin/Release/netcoreapp3.1/Tracs4Life.Website.dll</span><span> <a href="http://Tracs4Life.Website" target="_blank" rel="noopener nofollow noreferrer">Tracs4Life.Website</a> -> /opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Website/bin/Release/netcoreapp3.1/Tracs4Life.Website.Views.dll</span><span>Build succeeded.</span><span>Domain/TrainingTracs4LifeContext.cs(328,10): warning CS1030: #warning: 'To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see <a href="https://go.microsoft.com/fwlink/?linkid=2131148" target="_blank" rel="noopener nofollow noreferrer">https://go.microsoft.com/fwlink/?linkid=2131148</a>. For more guidance on storing connection strings, see <a href="http://go.microsoft.com/fwlink/?LinkId=723263.'" target="_blank" rel="noopener nofollow noreferrer">http://go.microsoft.com/fwlink/?LinkId=723263.'</a> [/opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Model/Tracs4Life.Model.csproj]</span><span>FacilityService.cs(21,46): warning CS0649: Field 'FacilityService._claimHelperService' is never assigned to, and will always have its default value null [/opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Service/Tracs4Life.Service.csproj]</span><span>Controllers/HomeController.cs(55,13): warning CS0162: Unreachable code detected [/opt/atlassian/pipelines/agent/build/Tracs4Life/Tracs4Life.Website/Tracs4Life.Website.csproj]</span><span> 3 Warning(s)</span><span> 0 Error(s)</span><span>Time Elapsed 00:00:13.15</span><span>+ dotnet build --no-restore --configuration Release</span>
<span>Microsoft (R) Build Engine version 16.7.2+b60ddb6f4 for .NET</span><span>Copyright (C) Microsoft Corporation. All rights reserved.</span><span> <a href="http://Tracs4Life.Website" target="_blank" rel="noopener nofollow noreferrer">Tracs4Life.Website</a> -> /opt/atlassian/pipelines/agent/build/Tracs4Life/publish/</span><span>+ dotnet publish --configuration Release --no-build ./Tracs4Life.Website/Tracs4Life.Website.csproj -o ./publish</span>
<span>Tracs4Life.Admin</span><span>Tracs4Life.Common</span><span>Tracs4Life.Interface</span><span>Tracs4Life.Model</span><span>Tracs4Life.Repository</span><span>Tracs4Life.Service</span><span><a href="http://Tracs4Life.Website" target="_blank" rel="noopener nofollow noreferrer">Tracs4Life.Website</a></span><span>Tracs4Life.sln</span><span>frontend</span><span>publish</span><span>+ls<br></span>
<span>Searching for files matching artifact pattern publish/**</span><span>Searching for test report files in directories named [test-results, failsafe-reports, test-reports, surefire-reports] down to a depth of 4</span><span>Finished scanning for test reports. Found 0 test report files.</span><span>Merged test suites, total number tests is 0, with 0 failures and 0 errors.</span><span>You already have a 'dotnetcore' cache so we won't create it again</span>
Even though the publish folder is present but it's still not archiving any artifacts.