commit a1f79cd60f59dea88e0af7ee642eb885bed43c9f
parent 5c886d12c62b506f0adf842c50d6dbeeebc1c6c8
Author: Andreas Gruhler <andreas.gruhler@adfinis.com>
Date: Wed, 3 Jul 2024 17:11:48 +0200
doc: difference between src/vars
Diffstat:
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/README b/README
@@ -1,6 +1,20 @@
= Shared Library for Jenkins =
-This repo contains shared pipeline code Jenkins library, primarly shared
-declarartive pipelines:
+This repo contains shared pipeline code Jenkins library, primarily shared
+declarative pipelines:
https://www.jenkins.io/doc/book/pipeline/shared-libraries/#defining-declarative-pipelines
+
+== Library in vars folder ==
+
+The `vars/` directory can hold files with functions or entire declarative
+pipelines. However, only one declarative pipeline can be executed in a single
+build.
+
+== Library in src folder ==
+
+Creating an actual class in the `src/` directory gives more flexibility,
+because multiple of these library classes can be instantiated sequentially in
+the invoking Jenkinsfile (scripted pipeline).
+
+Example: https://stackoverflow.com/a/53204143
diff --git a/src/BuildahBud.groovy b/src/BuildahBud.groovy
@@ -1,5 +1,4 @@
// A class to describe the Buildah bud stage
-// source: https://stackoverflow.com/a/53204143
class BuildahBud {
private final Script script
diff --git a/src/BuildahPush.groovy b/src/BuildahPush.groovy
@@ -1,5 +1,4 @@
// A class to describe the Buildah push stage
-// source: https://stackoverflow.com/a/53204143
class BuildahPush {
private final Script script