1/ Developer push code to TFS and it will send signal to CI server if it is a watching branch (in our case the branch is develop-int).
2/ CI server will carry on tasks, continue every next task when current task has no error. Finally, it will publish an artifact that is ready for CD server.
3/ CI server will trigger CD to start working and finally deploy the published artifacts if everything go smooth.
Here we only make use of Tasks, Variables and Triggers. We also skip VS Test as the sample is a dummy site.
1/ Select repository and branch
2/ Select ASP.NET template and apply
3/ Select Agent Queue, path to solution
4/ Navigate Get source, set – Clean: true – Clean Option: All build directories
5/ Update Use Nuget x.x.x, set – Version: >=4.0.0-0 (can be other version) – Run this task: Only when all previous tasks have succeeded
6/ Update NuGet restore, set – Feeds in my NuGet.config – Path to Nuget: Nuget.config (that in project root) – Run this task: Only when all previous tasks have succeeded
7/ Update Build solution – MSBuild Arguments: – /p:DeployOnBuild=true – /p:PublishProfile=WsPublishProfile.pubxml – /p:SkipInvalidConfigurations=true – /p:AutoParameterizationWebConfigConnectionStrings=False – /p:VisualStudioVersion=15.0 – Clean: true – Run this task: Only when all previous tasks have succeeded
8/ Disable Test Assemblies and Publish Symbols for future
9/ Create Copy File – Source Folder: DemoServer – Contents: *.config – Target Folder: .\Publish\App_Data\Sitefinity\Configuration\ – Overwrite: true – Run this task: Only when all previous tasks have succeeded
10/ Clone a copy file – Source Folder: DemoServer – Contents: Sitefinity.lic – Target Folder: .\Publish\App_Data\Sitefinity\ – Overwrite: true – Run this task: Only when all previous tasks have succeeded
11/ Update Publish Build Artifacts – Path to public: .\Publish – Run this task: Only when all previous tasks have succeeded
12/ Save and queue for a build. Finally see build succeeded!