Learn how to configure and run jobs in jenkins which automates the build, test and deploy phases with an example in ASP.NET Core.
Automation Servers are system nodes which perform predefined actions repetitively as a result of an event trigger or a periodic instruction with minimal or no manual intervention. And we shall look into setting up one such automation server which is also one of the most widely used tools in the market - Jenkins.
In a previous article, we were just getting started on automation server by installing and configuring a Jenkins automation server node onto a windows machine (Linux and Mac instructions added as well). In this journey, let's begin by setting up a Git repo and push all our local codebase into a central repo for the automation server to use.
Now that we have the server ready and repository linked up, next step ahead would be to pull code from the repository for a specified event - say like a timer, or a code commit or even a manual trigger, and run the build commands on the pulled code within the automation server.
So far we have seen how to fetch an aspnetcore codebase from a Git repository, how to automate the build of the fetched codebase and generate build artifacts. In this article we shall look at how we can automate executing test scripts on our fetched codebase after a build and generate a report out of it.
So far we have seen how to setup a remote repository for a standalone codebase via git and then tieing up the same to a jenkins build job for automation. Next we have seen how we can fetch latest codeset from the repository, build to generate artifacts and run unit test scripts on the same using aspnetcore, xunit and such.