I have an ASP.NET Core 3.0 application for which I have a full CI/CD setup in Azure DevOps. The Application is hosted on a Ubuntu 18.04 server machine.
In the Build Pipeline, the solution is built and afterward published to the ArtifactStagingDirectory.
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)\MyProject.$(build.BuildNumber).$(Build.BuildId).zip"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
This zip contains the complete folder structure of the server, which has IMHO nothing to do with the project. For me this is noise. For example:
/drop/MyProject.20191028.2.49/Content/d_C/a/1/s/MyProject/obj/Release/netcoreapp3.0/PubTmp/Out
Is it possible to reduce this folder structure to something like this or even less?
/drop/MyProject.20191028.2.49/Release/netcoreapp3.0/
At the moment, I am working around this in the release stage with a bash script.
drop=$(find /MyProject/Release/drop/MyProject.$(build.BuildNumber).$(Build.BuildId)/ -name "Out")
ln -s $drop /MyProject/Release/Current
In general, I am fine with this, but a little cleaner solution would be nice :)
*The application will be ported to .NET Core 3.1 as soon as it gets released. If this is relevant.