Jenkins Declarative Pipeline | Scripted Pipeline | Blue Ocean | Snippet Generator | DevOps

Опубликовано: 13 Сентябрь 2020
на канале: total-qa
719
14

Jenkins Part 1 Tutorial:
   • DevOps CI/CD Pipeline Tutorial | Jenk...  
Jenkins Part 2 Tutorial:
• Pipeline
:Pipeline is mainly useful to integrate the continuous integration and delivery using the different set of plugins.

• Manage Jenkins

Configure System
Global Tool Configuration
Manage Plugins
https://updates.jenkins-ci.org/downlo...
• Environmental Variables:
http://127.0.0.1:8080/env-vars.html/
echo %WORKSPACE%
echo %BUILD_ID%
Pre-Defined Environmental Variables:
Jenkins-Manage Jenkins-Configure System-Global Properties
echo %SELENIUM_REPO%

• Jenkins Backup:
C:\Program Files (x86)\Jenkins
• Dependency between the jobs:
Google Health Check: To validate google website is up and running.
+--- Execute Regression tests on Google
Post Build Actions:
Projects to Build:
Job Name
Execute only if the build is stable.
Job1 GoogleHealthCheck_Ex : DownStream job : job2 TriggerRegTests_Google
Job 2 TriggerRegTests_Google : UpStream Job : Job1 GoogleHealthCheck_Ex
• Build Pipeline View:
Plugin :https://updates.jenkins-ci.org/downlo...
Create a View -Select the option-Build Pipeline View-UpStream job


• Pipeline Script:
Jenkins 2.0 or later , scripting lang has to be used to execute the steps.
Groovy lang is preferred to execute the steps.
• Snippet Generator
git branch: 'modifyLicense_branch', url: 'https://github.com/totalqa9/SeleniumP...
• Scripted Pipeline
node{

stage('Download Code')

{


git branch: 'modifyLicense_branch', url: 'https://github.com/totalqa9/SeleniumP...


}


}

• Declarative Pipeline
pipeline{

agent any
stages{


stage('Download Code')
{

steps
{


git branch: 'modifyLicense_branch', url: 'https://github.com/totalqa9/SeleniumP...

echo 'Code Download Successful'


}

}

stage('Execute Tests')
{
steps{
dir("${env.WORKSPACE}/selautomationfwk")
{
// some block
bat label: 'Executing Selenium Tests', script: 'mvn clean test'
}
}
}


}
}
• Open Blue Ocean-Pipeline view of the stages
• Running the Jenkinsfile via Github