Signed-off-by: yminer <miner.yang@broadcom.com> |
||
---|---|---|
docs | ||
pipelines | ||
resources/io/goharbor | ||
src/io/goharbor | ||
vars | ||
LICENSE | ||
README.md |
README.md
Jenkins Shared Library
The experimental shared libraries for running E2E tests against Harbor instance(2.3+) on Jenkins.
Prerequisites
- Jenkins 2.249.1+
- Jenkins Plugins:
Runs As Jenkins Shared Library
-
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('harbor@2.3') _
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") } }
Libraries
- check_health
- import_trivy_db
- run_test_case
- publish_test_result
- send_to_slack
- run_fresh_install_pipeline