- Jenkins instance URL
- Jenkins Admin credentials
- Jenkins java option on startup: -Dhudson.model.ParametersAction.keepUndefinedParameters=true Note: Option needed starting from 4.8+ jenkins-master. Example: link
- Open Manage Jenkins -> Script Console
- Execute install_plugins.groovy script manually
- Restart Jenkins
- Disable scipt security for JobDSL to enable additional classpath for Pipeline+JobDSL steps disable-scripts-security-for-job-dsl-scripts.groovy
Note: for details visit https://issues.jenkins-ci.org/browse/JENKINS-40961 and https://github.com/jenkinsci/job-dsl-plugin/wiki/Migration#migrating-to-160
-> Verify that Manage Jenkins -> Configure Global Security -> Enable script security for Job DSL scripts is unchecked! - Declare required global variables by global-args-security.groovy
Note: Make sure to replace "CHANGE_ME" infraHost variable to valid data
-> Verify that Manage Jenkins -> Configure System has such global variables defined: INFRA_HOST, ZEBRUNNER_PIPELINE, ZEBRUNNER_VERSION, ZEBRUNNER_LOG_LEVEL and JENKINS_SECURITY_INITIALIZED - Setup Maven installer by configMavenAutoInstaller.groovy
-> Verify that Manage Jenkins -> Global Tool Configuration -> Maven installations contains declaration for 'M3' - Restart Jenkins
- Open Manage Jenkins -> Configure System
- Add into the Global Pipeline Libraries Zebrunner-CE entry
- Name: Zebrunner-CE
- Default version: main
- Load implicitly: false
- Allow default version to be overridden: true
- Include @Library changes in job recent changes: false
- Choose "Modern SCM->Git" options
- Repository URL: https://github.com/zebrunner/pipeline-ce.git
- Save changes
- Open Manage Jenkins -> Configure System
- Specify Pipeline Default Speed/Durability Level: Performance-optimized: much faster (requires clean shutdown to save running pipelines)
- Save changes
- Open Manage Jenkins -> Configure System -> Click "Add New Choice List" and register:
- gc_BUILD_PRIORITY
- name: gc_BUILD_PRIORITY
- values:
5 4 3 2 1
- Allow Add Edited Value: false
- gc_CUSTOM_CAPABILITIES
- name: gc_CUSTOM_CAPABILITIES
- values: NULL
- Allow Add Edited Value: false
Note: specify full list of custom capabilities resource files like browserstack/android/Samsung_Galaxy_S8.properties if needed
- gc_PIPELINE_LIBRARY
- name: gc_PIPELINE_LIBRARY
- values: Zebrunner-CE
- Allow Add Edited Value: true
- gc_RUNNER_CLASS
- name: gc_RUNNER_CLASS
- values:
com.zebrunner.jenkins.pipeline.runner.maven.TestNG com.zebrunner.jenkins.pipeline.runner.maven.Runner com.zebrunner.jenkins.pipeline.runner.gradle.Runner
- Allow Add Edited Value: true
- gc_GIT_TYPE
- name: gc_GIT_TYPE
- values:
github gitlab bitbucket
- Allow Add Edited Value: true
- Save changes
- Copy recursively Management_Jobs to $JENKINS_HOME/jobs
Warning: for unix based system make sure after copying with sudo permissions to change ownership to exact jenkins user and group, for example:cd /tmp git clone https://github.com/zebrunner/jenkins-master.git sudo cp -R jenkins-master/resources/jobs/Management_Jobs /var/lib/jenkins/jobs/ ls -la /var/lib/jenkins/jobs/ total 12 drwxr-xr-x 3 jenkins jenkins 4096 Sep 11 10:59 . drwxr-xr-x 16 jenkins jenkins 4096 Sep 11 10:50 .. drwxr-xr-x 3 root root 4096 Sep 11 10:59 Management_Jobs sudo chown -R jenkins:jenkins /var/lib/jenkins/jobs/
- Manage Jenkins -> Reload Configuration from Disk
- Verify that folder "Management_Jobs" is created with around 10 default jobs
-
Run Management_Jobs/RegisterOrganization job with parameters:
folderName: MyOrganization customPipeline: false Note: Provide Zebrunner reporting url and token as reportingServiceUrl and reportingAccessToken
-> Verify that MyOrganization folder is created at top of your jenkins with launcher and RegisterRepository jobs
-
Run MyOrganization/RegisterRepository job with parameters:
scmType: github pipelineLibrary: Zebrunner-CE runnerClass: com.zebrunner.jenkins.pipeline.runner.maven.TestNG repoUrl: https://github.com/qaprosoft/carina-demo.git branch: main scmUser: scmToken:
-> Verify that inside MyOrganization folder a lot of test jobs created (10+)
-
Run API-Demo-Test and Web-Demo-Test jobs with default parameters from MyOrganization/carina-demo folder
Note: make sure you have slaves with "api" and "web" labels
-> Verify that runs are registered successfully in Reporting Tool -
Follow Configuration and User guides to setup CI/CD process for Test Automation.