Skip to content

Commit

Permalink
Add implemntation to get component names from Input manifest
Browse files Browse the repository at this point in the history
Signed-off-by: Divya Madala <divyaasm@amazon.com>
  • Loading branch information
Divyaasm committed Mar 7, 2024
1 parent 8fe1005 commit a9c2a8b
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/jenkins/InputManifest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,35 @@ class InputManifest {
}
}

class Components extends HashMap<String, Component> {

Components(ArrayList data) {
data.each { item ->
Component component = new Component(item)
this[component.name] = component
}
}
}

class Component implements Serializable {
String name
String repository

Component(Map data) {
this.name = data.name
this.repository = data.repository
}

}

Build build
Ci ci
Components components

InputManifest(Map data) {
this.build = new InputManifest.Build(data.build)
this.ci = data.ci ? new InputManifest.Ci(data.ci) : null
this.components = new InputManifest.Components(data.components)
}

String getSHAsRoot(String jobName) {
Expand All @@ -68,4 +91,15 @@ class InputManifest {
'shas'
].join("/")
}

public ArrayList getNames() {
def componentsName = []
this.components.each { key, value -> componentsName.add(key) }
return componentsName
}

public String getRepo(String name) {
return this.components.get(name).repository
}

}

0 comments on commit a9c2a8b

Please sign in to comment.