The experimental shared libraries for running E2E tests against Harbor instance(2.3+) on Jenkins.
- Jenkins 2.249.1+
- Jenkins Plugins:
-
Register this repository as the
Global Pipeline Libraries
(namedharbor
) in Jenkins according to this guide. -
Import the registered library in
Jenkinsfile
:// import main branch to run cases against Harbor instance deployed from main 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
-
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 = "main" run_test_case(instance, caseSettings, "workdir") } stage('Publish-Result') { publish_test_result("workdir/result") } }