Skip to content

Commit

Permalink
Add rpm-validation pipelines trigger to opensearch and dashboards dis…
Browse files Browse the repository at this point in the history
…tribution builds (#2021)

* Add rpm-validation pipelines trigger to opensearch and dashboards distribution builds

Signed-off-by: Peter Zhu <[email protected]>

* Restore manifests

Signed-off-by: Peter Zhu <[email protected]>

* Add changes based on the comments

Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon authored Apr 22, 2022
1 parent 464b769 commit 8ebd79d
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 3 deletions.
20 changes: 20 additions & 0 deletions jenkins/opensearch-dashboards/distribution-build.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,16 @@ pipeline {
echo "buildManifestUrl (x64, rpm): ${buildManifestUrl}"
echo "artifactUrl (x64, rpm): ${artifactUrl}"

String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)

echo "Trigger rpm validation for x64 rpm ${bundleManifestUrl}"
build job: 'rpm-validation',
propagate: false,
wait: true,
parameters: [
string(name: 'BUNDLE_MANIFEST_URL', value: bundleManifestUrl),
string(name: 'AGENT_LABEL', value: AGENT_X64)
]
}
}
post {
Expand Down Expand Up @@ -347,6 +357,16 @@ pipeline {
echo "buildManifestUrl (arm64, rpm): ${buildManifestUrl}"
echo "artifactUrl (arm64, rpm): ${artifactUrl}"

String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)

echo "Trigger rpm validation for arm64 rpm ${bundleManifestUrl}"
build job: 'rpm-validation',
propagate: false,
wait: true,
parameters: [
string(name: 'BUNDLE_MANIFEST_URL', value: bundleManifestUrl),
string(name: 'AGENT_LABEL', value: AGENT_ARM64)
]
}
}
post {
Expand Down
22 changes: 20 additions & 2 deletions jenkins/opensearch/distribution-build.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ pipeline {
}
steps {
script {
git url: 'https://github.com/opensearch-project/opensearch-build.git', branch: 'main'
buildManifest(
inputManifest: "manifests/${INPUT_MANIFEST}",
distribution: 'tar',
Expand Down Expand Up @@ -112,7 +111,6 @@ pipeline {
}
steps {
script {
git url: 'https://github.com/opensearch-project/opensearch-build.git', branch: 'main'
buildManifest(
inputManifest: "manifests/${INPUT_MANIFEST}",
distribution: 'tar',
Expand Down Expand Up @@ -237,6 +235,16 @@ pipeline {
echo "buildManifestUrl (x64, rpm): ${buildManifestUrl}"
echo "artifactUrl (x64, rpm): ${artifactUrl}"

String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)

echo "Trigger rpm validation for x64 rpm ${bundleManifestUrl}"
build job: 'rpm-validation',
propagate: false,
wait: true,
parameters: [
string(name: 'BUNDLE_MANIFEST_URL', value: bundleManifestUrl),
string(name: 'AGENT_LABEL', value: AGENT_X64)
]
}
}
post {
Expand Down Expand Up @@ -350,6 +358,16 @@ pipeline {
echo "buildManifestUrl (arm64, rpm): ${buildManifestUrl}"
echo "artifactUrl (arm64, rpm): ${artifactUrl}"

String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)

echo "Trigger rpm validation for arm64 rpm ${bundleManifestUrl}"
build job: 'rpm-validation',
propagate: false,
wait: true,
parameters: [
string(name: 'BUNDLE_MANIFEST_URL', value: bundleManifestUrl),
string(name: 'AGENT_LABEL', value: AGENT_ARM64)
]
}
}
post {
Expand Down
2 changes: 1 addition & 1 deletion jenkins/rpm-validation/rpm-validation.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pipeline {
parameters {
string(
name: 'BUNDLE_MANIFEST_URL',
description: 'The bundle manifest url. (e.g. https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.0.0-rc1/2493/linux/x64/rpm/dist/opensearch/manifest.yml)',
description: 'The bundle manifest url, required for yum staging repo file. (e.g. https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.0.0-rc1/2493/linux/x64/rpm/dist/opensearch/manifest.yml)',
trim: true
)
string(
Expand Down
9 changes: 9 additions & 0 deletions src/jenkins/BuildManifest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ class BuildManifest implements Serializable {
].join("/")
}

public String getBundleManifestUrl(String publicArtifactUrl = 'https://ci.opensearch.org/ci/dbc', String jobName, String buildNumber) {
return [
this.getArtifactRootUrl(publicArtifactUrl, jobName, buildNumber),
'dist',
this.build.getFilename(),
'manifest.yml'
].join("/")
}

public String getArtifactUrl(String publicArtifactUrl = 'https://ci.opensearch.org/ci/dbc', String jobName, String buildNumber) {
return [
this.getArtifactRootUrl(publicArtifactUrl, jobName, buildNumber),
Expand Down

0 comments on commit 8ebd79d

Please sign in to comment.