2025-01-17 08:25:04 +00:00
|
|
|
package com.freeleaps.devops
|
|
|
|
|
|
|
|
|
|
class SourceFetcher {
|
|
|
|
|
def steps
|
|
|
|
|
|
|
|
|
|
SourceFetcher(steps) {
|
|
|
|
|
this.steps = steps
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-21 09:01:31 +00:00
|
|
|
def fetch(Map configurations) {
|
2025-01-22 07:26:07 +00:00
|
|
|
echo configurations
|
2025-01-21 09:01:31 +00:00
|
|
|
if (configurations.SERVICE_GIT_REPO == null || configurations.SERVICE_GIT_REPO.isEmpty()) {
|
|
|
|
|
steps.error("SERVICE_GIT_REPO is required")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (configurations.SERVICE_GIT_BRANCH == null || configurations.SERVICE_GIT_BRANCH.isEmpty()) {
|
|
|
|
|
steps.error("SERVICE_GIT_BRANCH is required")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
steps.git branch: configurations.SERVICE_GIT_BRANCH, credentialsId: 'git-bot-credentials', url: configurations.SERVICE_GIT_REPO
|
2025-01-17 08:25:04 +00:00
|
|
|
}
|
|
|
|
|
}
|