forked from opensearch-project/opensearch-build
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Dashboards] check BuildManifest has artifacts (opensearch-project#1568)
Verifies if the build manifest has artifacts or not before using the value. This allows for components that don't produce build artifacts to be passed to the groovy class without failing. Issue resolved: opensearch-project#1565 Signed-off-by: Kawika Avilla <[email protected]>
- Loading branch information
Showing
4 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
tests/jenkins/jobs/BuildManifest_Jenkinsfile_component_no_artifact
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
def lib = library("jenkins") | ||
|
||
pipeline { | ||
agent none | ||
stages { | ||
stage('Build Manifest Properties') { | ||
steps { | ||
script { | ||
def buildManifest = lib.jenkins.BuildManifest.new(readYaml(file: "tests/data/opensearch-dashboards-build-1.2.0.yml")) | ||
echo buildManifest.build.name | ||
echo buildManifest.build.version | ||
echo buildManifest.build.platform | ||
echo buildManifest.build.architecture | ||
echo buildManifest.build.getFilename() | ||
echo buildManifest.getArtifactRoot('bundle-build', '1') | ||
echo buildManifest.getArtifactRootUrl('https://ci.opensearch.org/ci/dbc', 'bundle-build', '1') | ||
echo buildManifest.build.getPackageName() | ||
echo buildManifest.components.getMinArtifact() | ||
} | ||
} | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
tests/jenkins/jobs/BuildManifest_Jenkinsfile_component_no_artifact.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
BuildManifest_Jenkinsfile_component_no_artifact.run() | ||
BuildManifest_Jenkinsfile_component_no_artifact.library(jenkins) | ||
BuildManifest_Jenkinsfile_component_no_artifact.pipeline(groovy.lang.Closure) | ||
BuildManifest_Jenkinsfile_component_no_artifact.echo(Executing on agent [label:none]) | ||
BuildManifest_Jenkinsfile_component_no_artifact.stage(Build Manifest Properties, groovy.lang.Closure) | ||
BuildManifest_Jenkinsfile_component_no_artifact.script(groovy.lang.Closure) | ||
BuildManifest_Jenkinsfile_component_no_artifact.readYaml({file=tests/data/opensearch-dashboards-build-1.2.0.yml}) | ||
BuildManifest.asBoolean() | ||
BuildManifest_Jenkinsfile_component_no_artifact.echo(OpenSearch Dashboards) | ||
BuildManifest_Jenkinsfile_component_no_artifact.echo(1.2.0) | ||
BuildManifest_Jenkinsfile_component_no_artifact.echo(linux) | ||
BuildManifest_Jenkinsfile_component_no_artifact.echo(x64) | ||
BuildManifest_Jenkinsfile_component_no_artifact.echo(opensearch-dashboards) | ||
BuildManifest.getArtifactRoot(bundle-build, 1) | ||
BuildManifest_Jenkinsfile_component_no_artifact.echo(bundle-build/1.2.0/1/linux/x64) | ||
BuildManifest.getArtifactRootUrl(https://ci.opensearch.org/ci/dbc, bundle-build, 1) | ||
BuildManifest_Jenkinsfile_component_no_artifact.echo(https://ci.opensearch.org/ci/dbc/bundle-build/1.2.0/1/linux/x64) | ||
BuildManifest_Jenkinsfile_component_no_artifact.echo(opensearch-dashboards-1.2.0-linux-x64.tar.gz) | ||
BuildManifest.getMinArtifact() | ||
BuildManifest_Jenkinsfile_component_no_artifact.echo(dist/opensearch-dashboards-min-1.2.0-linux-x64.tar.gz) |