Posts

Jenkins : Email notification on job failure

Image
Introduction In this article, I will show you how to send email notification in case of job failure. 1.    Install 'Mailer plugin for Jenkins' 2.    Configure Mailer plugin to use 3.    Create Job named TestEmailJob Step1: Install 'Mailer plugin for Jenkins' Go to Home->Manage Jenkins->Manage Plugins->Installed tab. Look for the Mailer plugin as shown below. By default, it is installed when Jenkins is installed. If not then it can be installed here. Step2: Configure 'Mailer plugin' to use Go to Home->Manage Jenkins->Configure System->E-mail Notification section. Fill up the SMTP server details as shown below. And there is a Test Configuration option in the section to check whether it is working or not. Step3: Create Job named TestEmailJob Go to Home->New Item and create new job named TestEmailJob as shown in previous examples. Now go to TestEmailJob->Configure->Build section.  Here, I have intentionally, 'echo' spelling is wr...

Jenkins : Triggering Jobs in Sequence

Image
Introduction In this article, I will show you how to trigger jobs in sequence in Jenkins 1.      Create Job TestJob1 2.     Create Job TestJob2 3.     Build Job    TestJob1 Step1: Create Job TestJob1 Create a FreeStyle Project named TestJob1 as shown in blog titled ' Step by step guide for Jenkins FreeStyle Project ' After that go to TestJob1->Build tab and add buid step as shown below: Step2: Create Job TestJob2 Same way create TestJob2. But message in Command keep as 'Test Job2 executed successfully'. Now here, I want to execute TestJob2 automatically after TestJob1 is executed.  So go to TestJob2->BuildTriggers section and make the changes as shown below: Step3: Build TestJob1 Now, Go to Home->TestJob1 and click Build Now button shown in left menu. It will build the TestJob1 which can be shown in Build History marked  as shown in image You can view the console for the Build #1 for TestJob1 by going to Build History->#...

Step by step guide for Jenkins FreeStyle Project

Image
Introduction In this article, we will be creating jenkins free style project  for build, test and deploy WebApi (asp.net core) project. Steps will be as follows: 1. Install Jenkins on Windows Machine 2. Create WebAPI and MSTest project using Visual Studio 3. Identify steps and plugins required for CI/CD 4. Install Jenkins Plugins 5. Configure Plugins 6. Create a FreeStyle Job Step1: Install Jenkins on Windows Machine Download and Install latest version of jdk from below URL. https://www.oracle.com/technetwork/java/javase/downloads/index.html Download and Install Jenkins from  https://jenkins.io/download/  by clicking on Windows option. Follow the installation instructions. Step2: Create WebAPI and MSTest Project on Windows 1. Create simple WebAPI project and MSTest project. 2. Create account on www.github.com and create repository on it. 3. Download git from https://git-scm.com/downloads and install it. 4. Push the code i...