Jenkins Integration - alandiaz08/e2e-web-framework GitHub Wiki
Jenkins offers a continuous integration and and an automation environment, which helps developers and testers to integrate their changes as and when they are made and build the code automatically. It also ensures constant monitoring of the application and runs jobs on a scheduled basis.
How does Jenkins-GitHub work?
-
Jenkins is configured with the Github repository using the GitHub plugin and and GitHub authentication plugin. Source
-
A Jenkins pipeline is defined on the JenkinsFile and checked in along with version control to Git.
-
Jenkins server constantly watches if there is a pull request or a scheduled build.If there is one , Jenkins
3.1. Pulls the JenkinsFile from source control.
3.2. Gets the URL of the repository and the identifies the most recent commit.
3.3. Identifies the cause of the build whether it is a pullRequest or a time-triggered or a user-triggered one.
3.4. Establishes connection with GitHub using the credentials.
3.5. At this point, the required options, agent and parameters are set up in the pipeline.
Options : These are pipeline specific options required to be set up before the build execution such as buildDiscarder, timeout, disableConcurrentBuilds etc.
Agent : Specifies where the build execution takes place for example, Kubernetes.
Parameters : These are default parameters that are provided before the start of the build execution for example, environment, browser, seleniumGridURL etc. Pipeline Syntax
3.6. Staged build begins to execute. It is called staged because the build executes in stages sequentially one after the other.
3.6.1. At the very first stage, the notification is sent to the slack channel and Jenkins starts Gradle daemon.
3.6.2. SonarQube checks are done if buildCause is a pullRequest and is skipped otherwise.
If the cause = pullRequest/changeRequest, the build includes an additional stage sonarQube and performs staticAnalysis on the code. If the build is triggered manually or a timed event,the sonarQube check does not take place.
3.6.3. At this stage, the actual test execution takes place.
3.6.4. Once the test execution is finished, the video recording is added to the extentReport. Now the extentReports and logs are published on the Jenkins workspace.
3.7. Once the staged execution is completed, the status of the build is updated a message is sent to the slack channel.