Skip to content

YangJiao0817/jenkins-shared-library

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jenkins Shared Library

The experimental shared libraries for running E2E tests against Harbor instance(2.3+) on Jenkins.

Prerequisites

Runs As Jenkins Shared Library

  1. Register this repository as the Global Pipeline Libraries(named harbor) in Jenkins according to this guide.

  2. Import the registered library in Jenkinsfile:

    // import main branch to run cases against Harbor instance deployed from master branch
    @Library('harbor@main') _
    
    // import 2.3 branch to run cases against Harbor instance v2.3.x
    @Library('[email protected]') _
    

    Notes: Import the corresponding branch of the library for the Harbor instance to be tested. e.g. for Harbor v2.3.x importing branch 2.3

  3. Use the libraries in Jenkinsfile

    @Library('harbor@main') _
    import io.goharbor.*
    
    node() {
        HarborInstance instance = new HarborInstance()
        instance.coreServiceURL = "https://harbor.local"
        instance.notaryServiceURL = "https://notary.harbor.local"
    
        stage('Health-Check') {
            check_health(instance)
        }
        stage('Test') {
            CaseSettings caseSettings = new CaseSettings()
            caseSettings.branch = "master"
            run_test_case(instance, caseSettings, "workdir")
        }
        stage('Publish-Result') {
            publish_test_result("workdir/result")
        }
    }
    

Libraries

Pipelines

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 61.7%
  • Groovy 37.3%
  • Dockerfile 1.0%