Devops pipeline for V4.30

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 năm cách đây
Given that the 4.3 release is imminent, I plan on documenting my progress for converting my 4.0 pipeline to 4.3 here. It may offer suggestions and help to others, so thought it would help...

I have not worked on nop-commerce in a while so my build pipeline is out of date...

I am not sure why the nop team chose Travis over AzurePipelines, but I am guessing many users would want to deploy to AzureDevops (like we do)...

First of all, I have generated adjusted the pipeline that generates the build YAML:

pool:
  name: Azure Pipelines
steps:
- task: DotNetCoreCLI@2
  displayName: 'dotnet restore'
  inputs:
    command: restore
    projects: ./src/NopCommerce.sln
- task: DotNetCoreCLI@2
  displayName: 'dotnet build'
  inputs:
    projects: ./src/NopCommerce.sln
    arguments: '--configuration $(BuildConfiguration)'
- task: DotNetCoreCLI@2
  displayName: 'dotnet test'
  inputs:
    command: test
    projects: |
     ./src/Tests/Nop.Core.Tests/Nop.Core.Tests.csproj
     ./src/Tests/Nop.Web.MVC.Tests/Nop.Web.MVC.Tests.csproj
     ./src/Tests/Nop.Services.Tests/Nop.Services.Tests.csproj
    arguments: '--configuration $(BuildConfiguration) --collect "Code coverage"'
- task: DotNetCoreCLI@2
  displayName: 'dotnet publish'
  inputs:
    command: publish
    arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
  displayName: 'Publish Artifact'
  inputs:
    ArtifactName: '$(Parameters.ArtifactName)'

something like this could be added to the file  
azure-pipelines.yml
in root of the project if using a private GitHub account connected to Azure DevOps (VisualStudio Online) build pipeline.

I plan on looking at making code coverage work in the interface soon and  https://stackoverflow.com/questions/60893419/azure-devops-code-coverage-for-net-core-3-1 seems to show the way. I will update the above if required...

Next will be the release pipeline...
3 năm cách đây
Release pipeline info will be here.

First problem to overcome is whether to have a template of App_Data\dataSettings.json deployed so that predefined vars can be automatically populate them. Previously I did this by updating the original source, however I now feel that this should be generated by the build pipeline... :thinking!
3 năm cách đây
Unfortunately it doesn't seem possible to deploy using the azure devops release process without adding a template of
App_Data/dataSettings.json
because a transform can only happen on deploy which is already a zip file (so a script process cannot be used to generate it on the fly). Shame... I have added it to the bugs thread but not hopeful that it will make it into the 4.3 release. A work around will be to branch the official repo and add it separately (as I did previously) but far from ideal...
3 năm cách đây
For my own reference, and also hoping that the core dev team take note, I have created the following blog posts!

https://networkfusion.wordpress.com/2020/05/19/nopcommerce-4-3-build-pipeline-on-visualstudio-online-azure-devops-vsts/
and
https://networkfusion.wordpress.com/2020/05/19/nopcommerce-4-3-build-pipeline-on-visualstudio-online-azure-devops-with-code-coverage/
3 năm cách đây
This is a great post and really helpful. Thanks for sharing.
It's unfortunate that there isn't more of this sort of help in this community.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.