Deployment API - Commerce (build package issue)

Vote:
 

Has anyone successfully deployed commerce websites using the deployment API?

I am having an issue, trying to build the commerce manager package using the steps outlined in Anders post here:

https://world.episerver.com/blogs/anders-wahlqvist/dates/2019/10/azure-devops-and-episerver-deployment-api/

I am using the YML pipeline he describles here:

https://github.com/AWahlqvist/alloy-mvc-template/blob/master/azure-pipelines.yml

The issue I am experiencing is that it uses WebPublishMethod="Filesystem" which is causing an issue (i think). It first builds the CMS website (as files - not as a package) and overwrites the Commerce Manager on top of it (because it's the same location specified in the 'publishurl'). This is not an issue with the tradtional deployment because it creates two separate packages/artificats in the drop folder. 

Would love ot know if someone else has experienced this issue and a way to fix it?

#252729
Apr 08, 2021 15:31
Vote:
 

Hi Aniket,

The article you reference describes creating a single package. In the YAML you posted, you need to create two nuget packages. One for cms and one for commerce manager. This basically means you need run the VS Build once for cms, then create nupkg. Then a VS build for commerce resulting in another nupkg.

Once you have those its just a case of building two release pipelines targetting the two separate nupkgs. This allow also allow you to deploy separately.

I would also recommend taking a look at direct deploy. This reduced our deployment time from 40 minutes to 8 minutes! https://world.episerver.com/blogs/anders-wahlqvist/dates/2021/3/introducing-direct-deploy-a-quicker-way-to-deploy-to-dxp/ same article by Anders.

#252735
Apr 08, 2021 16:41
Vote:
 

Hi Surjit,

Thanks for the response. Unfortunately, when creating a package for the CMS it automatically builds and adds the commerce manager on top of it. Also, I don't know a way to build commerce manager package separately (VS build requires a solution file to be selected not a .csproj file). 

I believe the root cause, is related to the .targets file in the Commerce Manager nuget package > build folder that tells the build which files to include using the <import Project> tag in the csproj file. This works fine with the traditional build and package (create artifacts for both cms and commerce in the drop folder which can be selected for the release pipelines) but not when using FileSystem as the publish method where raw files are generated in the location specified by the publishurl.

Aniket

#252739
Apr 08, 2021 16:59
Vote:
 

You can specify vsbuild to select a csproj.

- task: vsbuild

inputs:

solution: '**/Web/Episerver.Web.csproj'

Set the publishUrl to be inside a temp directory you can also access from the release pipeline.

#252742
Apr 08, 2021 18:18
Vote:
 

Thanks Surjit! That worked. The build was failing for a different reason when selecting the *.csproj file. I rectified the issue and that resolved it.  

#252981
Apr 10, 2021 5:54
Surjit Bharath - Apr 10, 2021 6:48
No problem!
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.