|
|
|
@ -1,7 +1,8 @@
|
|
|
|
|
|
|
|
|
|
def counts = 0
|
|
|
|
|
def projects2artifacts=[:]
|
|
|
|
|
def modules2deps=[:]
|
|
|
|
|
def projects2artifacts = [:]
|
|
|
|
|
def modules2deps = [:]
|
|
|
|
|
def inputProject = 'storagehub-client-library'
|
|
|
|
|
|
|
|
|
|
pipeline {
|
|
|
|
|
agent {
|
|
|
|
@ -29,12 +30,44 @@ pipeline {
|
|
|
|
|
m.getDependencies().each { d -> modules2deps[m.name] << "${d.groupId}:${d.artifactId}" }
|
|
|
|
|
}
|
|
|
|
|
println "FOUND ${modules2deps.size()} modules"
|
|
|
|
|
modules2deps.each { k,v -> println ("MODULE ${k} DEPENDS on ${v}") }
|
|
|
|
|
//modules2deps.each { k,v -> println ("MODULE ${k} DEPENDS on ${v}") }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stage('find downstream projects') {
|
|
|
|
|
steps {
|
|
|
|
|
script {
|
|
|
|
|
println "PROJECT ${inputProject} BUILDS ${projects2artifacts[inputProject]} artifacts"
|
|
|
|
|
// first, let's find out what components depends on the project's artifacts
|
|
|
|
|
def downstreamdeps = [:]
|
|
|
|
|
projects2artifacts[inputProject].each { a ->
|
|
|
|
|
downstreamdeps[a] = []
|
|
|
|
|
downstreamdeps[a] << findDownstreamDependencies(modules2deps, a)
|
|
|
|
|
println "${a} is used by ${downstreamdeps[a]}"
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// then we look for the projects that build the downstream dependencies
|
|
|
|
|
//downstreamdeps.each { k, v ->
|
|
|
|
|
// println "${k} is build by ${findProject()}"
|
|
|
|
|
//}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
def findDownstreamDependencies(modules2deps, artifact) {
|
|
|
|
|
def downdeps = []
|
|
|
|
|
println "Looking for users of ${artifact}"
|
|
|
|
|
modules2deps.each { k,v -> if (v.contains("${artifact}")) downdeps << k }
|
|
|
|
|
downdeps
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def findProject(projects2artifacts, artifact) {
|
|
|
|
|
println "Looking for project that builds ${artifact}"
|
|
|
|
|
projects2artifacts.find { k,v -> v.contains("${artifact}")}.first.key
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
def printJob(job) {
|
|
|
|
|