package com.freeleaps.devops class SourceFetcher { def steps SourceFetcher(steps) { this.steps = steps } def fetch(configurations) { if (configurations.serviceGitRepo == null || configurations.serviceGitRepo.isEmpty()) { steps.error("serviceGitRepo is required") } if (configurations.serviceGitBranch == null || configurations.serviceGitBranch.isEmpty()) { steps.error("serviceGitBranch is required") } steps.env.workspace = "workspace" dir(steps.env.workspace) { steps.git branch: configurations.serviceGitBranch, credentialsId: 'git-bot-credentials', url: configurations.serviceGitRepo } } }