Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into jenkins_incremental
Browse files Browse the repository at this point in the history
  • Loading branch information
zelinh committed Jan 17, 2024
2 parents d4edbe9 + b195cb2 commit a20f2fb
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ out.txt
.classpath
bin/*


logback.log
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jacocoTestReport {
}
}

String version = '6.0.0'
String version = '6.1.0'

task updateVersion {
doLast {
Expand Down
27 changes: 16 additions & 11 deletions src/jenkins/BuildManifest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

package jenkins

class BuildManifest implements Serializable {

class Build implements Serializable {

String id
String name
String version
Expand Down Expand Up @@ -57,6 +58,7 @@ class BuildManifest implements Serializable {
this.architecture,
].join('-') + '.' + getExtension()
}

}

class Components extends HashMap<String, Component> {
Expand All @@ -67,9 +69,11 @@ class BuildManifest implements Serializable {
this[component.name] = component
}
}

}

class Component implements Serializable {

String name
String version
String ref
Expand Down Expand Up @@ -103,25 +107,25 @@ class BuildManifest implements Serializable {
buildNumber,
this.build.platform,
this.build.architecture
].join("/")
].join('/')
}

public String getArtifactRoot(String jobName, String buildNumber) {
return [
this.getArtifactRootWithoutDistribution(jobName, buildNumber),
this.build.distribution
].join("/")
].join('/')
}

public String getIndexFileRoot(String jobName) {
return [
jobName,
this.build.version,
"index",
'index',
this.build.platform,
this.build.architecture,
this.build.distribution
].join("/")
].join('/')
}

public String getArtifactRootUrlWithoutDistribution(String publicArtifactUrl = 'https://ci.opensearch.org/ci/dbc', String jobName, String buildNumber) {
Expand All @@ -144,7 +148,7 @@ class BuildManifest implements Serializable {
'builds',
this.build.getFilename(),
'manifest.yml'
].join("/")
].join('/')
}

public String getBundleManifestUrl(String publicArtifactUrl = 'https://ci.opensearch.org/ci/dbc', String jobName, String buildNumber) {
Expand All @@ -153,7 +157,7 @@ class BuildManifest implements Serializable {
'dist',
this.build.getFilename(),
'manifest.yml'
].join("/")
].join('/')
}

public String getArtifactUrl(String publicArtifactUrl = 'https://ci.opensearch.org/ci/dbc', String jobName, String buildNumber) {
Expand All @@ -162,7 +166,7 @@ class BuildManifest implements Serializable {
'dist',
this.build.getFilename(),
this.build.getFilenameWithExtension()
].join("/")
].join('/')
}

public String getArtifactArchitecture() {
Expand All @@ -182,7 +186,7 @@ class BuildManifest implements Serializable {
}

public String getMinArtifact() {
components.get(build.name.replace(' ','-'))?.artifacts?.get("dist")?.first()
components.get(build.name.replace(' ', '-'))?.artifacts?.get('dist')?.first()
}

public String getCommitId (String name) {
Expand All @@ -191,11 +195,12 @@ class BuildManifest implements Serializable {

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

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

}
34 changes: 34 additions & 0 deletions src/jenkins/TestManifest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,64 @@
package jenkins

class TestManifest {

class Ci implements Serializable {
class Image implements Serializable {

String name
String args

Image(Map data) {
this.name = data.name
this.args = data.args
}

}

Image image

Ci(Map data) {
this.image = new TestManifest.Ci.Image(data.image)
}

}

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

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

}

String name

Ci ci
Components components

TestManifest(Map data) {
this.name = data.name
this.ci = data.ci ? new TestManifest.Ci(data.ci) : null
this.components = data.components ? new TestManifest.Components(data.components) : null
}

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

}

0 comments on commit a20f2fb

Please sign in to comment.