Add a dependency to the groovy library in Jenkins files

diff --git a/Jenkinsfile b/Jenkinsfile
index 1dfc41e..cfc1ca2 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,48 +1,36 @@
-def groovy
+def build = library(
+  identifier: 'rcptt-pipeline-library@groovy',
+  retriever: modernSCM(
+    [
+      $class: 'GitSCMSource',
+      remote: 'https://github.com/xored/rcptt.git'
+    ]
+  )
+).org.eclipse.rcptt.jenkins.Build.new(this)
 
 pipeline {
-  agent none
+  agent {
+    kubernetes {
+      label 'rcptt-build-agent-3.5.4'
+      yaml build.YAML_BUILD_AGENT
+    }
+  }
 
   stages {
-
-    stage('Load groovy script') {
-      agent any
-      stages {
-        stage('Checkout') {
-          steps {
-            checkout scm
-            script {
-              groovy = load('releng/Jenkinsfile.groovy')
-            }
-          }
+    stage('Start Build and Test') {
+      steps {
+        script {
+          build.build_and_test(false)
         }
       }
     }
+  }
 
-    stage('Launch agent') {
-      agent {
-        kubernetes {
-          label 'rcptt-build-agent-3.5.4'
-          yaml "${env.YAML_BUILD_AGENT}"
-        }
-      }
-      stages {
-        stage('Start Build and Test') {
-          steps {
-            script {
-              groovy.build_and_test(false)
-            }
-          }
-        }
-      }
-      post {
-        always {
-          script {
-            groovy.post_build_actions()
-          }
-        }
+  post {
+    always {
+      script {
+        build.post_build_actions()
       }
     }
-
   }
 }
\ No newline at end of file
diff --git a/releng/Jenkinsfile b/releng/Jenkinsfile
index a018386..be52d0c 100644
--- a/releng/Jenkinsfile
+++ b/releng/Jenkinsfile
@@ -1,7 +1,20 @@
-def groovy
+def build = library(
+  identifier: 'rcptt-pipeline-library@groovy',
+  retriever: modernSCM(
+    [
+      $class: 'GitSCMSource',
+      remote: 'https://github.com/xored/rcptt.git'
+    ]
+  )
+).org.eclipse.rcptt.jenkins.Build.new(this)
 
 pipeline {
-  agent none
+  agent {
+    kubernetes {
+      label 'rcptt-build-agent-3.5.4'
+      yaml build.YAML_BUILD_AND_DEPLOY_AGENT
+    }
+  }
 
   parameters {
     choice(name: 'MODE', choices: ['Release', 'Milestone'], description: 'The deploy mode')
@@ -9,55 +22,30 @@
   }
 
   stages {
-
-    stage('Load groovy script') {
-      agent any
-      stages {
-        stage('Checkout') {
-          steps {
-            checkout scm
-            script {
-              groovy = load('releng/Jenkinsfile.groovy')
-            }
+    stage('Start Build and Test') {
+      steps {
+        script {
+          if(params.MODE == 'Milestone') {
+            build.set_milestone(params.MILESTONE_VERSION)
           }
+          build.build_and_test(false)
         }
       }
     }
-
-    stage('Launch agent') {
-      agent {
-        kubernetes {
-          label 'rcptt-build-and-deploy-agent-3.5.4'
-          yaml "${env.YAML_BUILD_AND_DEPLOY_AGENT}"
-        }
-      }
-      stages {
-        stage('Start Build and Test') {
-          steps {
-            script {
-              if(params.MODE == 'Milestone') {
-                groovy.set_milestone(params.MILESTONE_VERSION)
-              }
-              groovy.build_and_test(true)
-            }
-          }
-        }
-        stage('Deploy') {
-          steps {
-            script {
-              groovy.deploy(params.MODE, params.MILESTONE_VERSION)
-            }
-          }
-        }
-      }
-      post {
-        always {
-          script {
-            groovy.post_build_actions()
-          }
+    stage('Deploy') {
+      steps {
+        script {
+          build.deploy(params.MODE, params.MILESTONE_VERSION)
         }
       }
     }
+  }
 
+  post {
+    always {
+      script {
+        build.post_build_actions()
+      }
+    }
   }
 }
\ No newline at end of file
diff --git a/releng/nightly/Jenkinsfile b/releng/nightly/Jenkinsfile
index 6c79f12..e534f1e 100644
--- a/releng/nightly/Jenkinsfile
+++ b/releng/nightly/Jenkinsfile
@@ -1,55 +1,43 @@
-def groovy
+def build = library(
+  identifier: 'rcptt-pipeline-library@groovy',
+  retriever: modernSCM(
+    [
+      $class: 'GitSCMSource',
+      remote: 'https://github.com/xored/rcptt.git'
+    ]
+  )
+).org.eclipse.rcptt.jenkins.Build.new(this)
 
 pipeline {
-  agent none
+  agent {
+    kubernetes {
+      label 'rcptt-build-agent-3.5.4'
+      yaml build.YAML_BUILD_AND_DEPLOY_AGENT
+    }
+  }
 
   stages {
-
-    stage('Load groovy script') {
-      agent any
-      stages {
-        stage('Checkout') {
-          steps {
-            checkout scm
-            script {
-              groovy = load('releng/Jenkinsfile.groovy')
-            }
-          }
+    stage('Start Build and Test') {
+      steps {
+        script {
+          build.build_and_test(true)
         }
       }
     }
-
-    stage('Launch agent') {
-      agent {
-        kubernetes {
-          label 'rcptt-build-and-deploy-agent'
-          yaml "${env.YAML_BUILD_AND_DEPLOY_AGENT}"
-        }
-      }
-      stages {
-        stage('Start Build and Test') {
-          steps {
-            script {
-              groovy.build_and_test(true)
-            }
-          }
-        }
-        stage('Deploy') {
-          steps {
-            script {
-              groovy.deploy("Nightly")
-            }
-          }
-        }
-      }
-      post {
-        always {
-          script {
-            groovy.post_build_actions()
-          }
+    stage('Deploy') {
+      steps {
+        script {
+          build.deploy("Nightly")
         }
       }
     }
+  }
 
+  post {
+    always {
+      script {
+        build.post_build_actions()
+      }
+    }
   }
 }
\ No newline at end of file
diff --git a/releng/tests/Jenkinsfile b/releng/tests/Jenkinsfile
index 79787fc..a37ccb4 100644
--- a/releng/tests/Jenkinsfile
+++ b/releng/tests/Jenkinsfile
@@ -1,47 +1,36 @@
-def groovy
+def build = library(
+  identifier: 'rcptt-pipeline-library@groovy',
+  retriever: modernSCM(
+    [
+      $class: 'GitSCMSource',
+      remote: 'https://github.com/xored/rcptt.git'
+    ]
+  )
+).org.eclipse.rcptt.jenkins.Build.new(this)
 
 pipeline {
-  agent none
+  agent {
+    kubernetes {
+      label 'rcptt-build-agent-3.5.4'
+      yaml build.YAML_BUILD_AGENT
+    }
+  }
+
   stages {
-
-    stage('Load groovy script') {
-      agent any
-      stages {
-        stage('Checkout') {
-          steps {
-            checkout scm
-            script {
-              groovy = load('releng/Jenkinsfile.groovy')
-            }
-          }
+    stage('Start Test') {
+      steps {
+        script {
+          build.tests(TESTS, RUNNER, ARGS)
         }
       }
     }
+  }
 
-    stage('Launch agent') {
-      agent {
-        kubernetes {
-          label 'rcptt-build-and-deploy-agent-3.5.4'
-          yaml "${env.YAML_BUILD_AND_DEPLOY_AGENT}"
-        }
-      }
-      stages {
-        stage('Start Test') {
-          steps {
-            script {
-              groovy.tests(TESTS, RUNNER, ARGS)
-            }
-          }
-        }
-      }
-      post {
-        always {
-          script {
-            groovy.post_build_actions()
-          }
-        }
+  post {
+    always {
+      script {
+        build.post_build_actions()
       }
     }
-
   }
 }
\ No newline at end of file