package com.freeleaps.devops class SourceFetcher { def steps SourceFetcher(steps) { this.steps = steps } def fetch(Map configurations) { 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 } }