Skip to content

Latest commit

 

History

History
125 lines (115 loc) · 5.83 KB

README.md

File metadata and controls

125 lines (115 loc) · 5.83 KB

Deploy Zebrunner CE pipelines to 3rd party Jenkins

Prerequisites

  • 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

Install required plugins

Finish configuration steps (via Manage Jenkins -> Script Console)

Declare Zebrunner-CE library

  • 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

Adjust Pipeline Speed/Durability Settings

  • Open Manage Jenkins -> Configure System
  • Specify Pipeline Default Speed/Durability Level: Performance-optimized: much faster (requires clean shutdown to save running pipelines)
  • Save changes

Declare required Global Extensible Choices

  • 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
  • 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

Create Management Jobs

  • 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

Test Zebrunner-CE pipeline

  • 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.