Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change extraction of the files for exported versions #271

Merged
merged 2 commits into from
Jul 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1106,9 +1106,7 @@ class SaagieClient {
)

if (configuration.job.include_all_versions && parsedV1job.versions) {
def versions = parsedV1job.versions.findAll { version ->
version.number != parsedV1job.current.number
}
def versions = parsedV1job.versions

versions.sort { x, y ->
x.number <=> y.number
Expand All @@ -1120,8 +1118,6 @@ class SaagieClient {
getRunTimeVersionMapper(technologyV2VersionForVersions, technologyV2),
version)
}

exportJob.versions.unique()
}

if (current.file) {
Expand Down Expand Up @@ -1238,7 +1234,6 @@ class SaagieClient {
exportPipeline.addPipelineVersionDtoToVersions(item.jobs, null, null)
}
if (exportPipeline.versions.size() > 1) {
exportPipeline.versions.unique()
exportPipeline.versions.withIndex().collect { workflow, index ->
workflow.number = "${index + 1}"
workflow.jobs = workflow.jobs.collect { job ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ class SaagieClientUtils {
def packageFile = new File( "${ jobFolderPath }/${ EXPORTED_JOB_PACKAGE_FOLDER_NAME }" ).listFiles()
def packageFileHead = null
if ( packageFile && packageFile.head() ) {
packageFileHead = packageFile.head()
packageFileHead = packageFile.find {
if(!it.isDirectory()) {
return true
}
return false
}
}
extractedConfig.jobs[ jobId ].package = packageFileHead
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ class ImportPipelineService {
def jobForPipeVersionArray = []

if (jobs && JobsFromPipelines) {
def jobsByNames = JobsFromPipelines.name
jobs.each { job ->
JobsFromPipelines.each { jobPipeline ->
if (jobPipeline.name == job.name) {
jobForPipeVersionArray.add(job.id)
}
def existingJob = jobsByNames.find { it.equals(job.name)}
if(existingJob) {
jobForPipeVersionArray.add(job.id)
}
}
}
Expand Down