Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add standard release pipeline library #11

Merged
merged 9 commits into from
Oct 19, 2022

Conversation

gaiksaya
Copy link
Member

@gaiksaya gaiksaya commented Oct 1, 2022

Signed-off-by: Sayali Gaikawad gaiksaya@amazon.com

Description

Add standard release pipeline library

Issues Resolved

resolves opensearch-project/opensearch-build#1606

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@gaiksaya
Copy link
Member Author

gaiksaya commented Oct 1, 2022

Keeping it in draft till I get the tests fixed. I am missing something for sure:

TestStandardReleasePipeline > testStandardReleasePipeline FAILED
    groovy.lang.MissingPropertyException: Exception evaluating property 'overrideDockerImage' for java.util.Arrays$ArrayList, Reason: groovy.lang.MissingPropertyException: No such property: overrideDockerImage for class: StandardReleasePipeline_JenkinsFile
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.getAtIterable(DefaultGroovyMethods.java:8761)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.getAt(DefaultGroovyMethods.java:8749)
        at groovy.lang.MetaClassImpl$7.getProperty(MetaClassImpl.java:2082)
        at org.codehaus.groovy.runtime.callsite.GetEffectivePojoPropertySite.getProperty(GetEffectivePojoPropertySite.java:63)

@prudhvigodithi
Copy link
Member

Hey @gaiksaya i see the issue is the created lib-tester StandardReleasePipelineLibTester, which does not consider args as class variables.
I have removed the this.registerLibTester(new StandardReleasePipelineLibTester('AL2-X64', 'test:image')) and with just super.setUp() in TestStandardReleasePipeline.grrovy, the tests pass.

Output
I can see the overrideAgent and overrideDockerImage are passed right.

TestStandardReleasePipeline > testStandardReleasePipeline STANDARD_OUT
    Loading shared library jenkins with version <notNeeded>
    Executing on agent [docker:[image:test:image, reuseNode:false, stages:[:], args:, alwaysPull:true, containerPerStageRoot:false, label:AL2-X64]]
    fakePublishToMaven [mavenArtifactsPath:/maven, autoPublish:true]
       StandardReleasePipeline_JenkinsFile.run()
          StandardReleasePipeline_JenkinsFile.standardReleasePipeline({overrideAgent=AL2-X64, overrideDockerImage=test:image}, groovy.lang.Closure)
             standardReleasePipeline.pipeline(groovy.lang.Closure)
                standardReleasePipeline.timeout({time=1, unit=HOURS})
                standardReleasePipeline.echo(Executing on agent [docker:[image:test:image, reuseNode:false, stages:[:], args:, alwaysPull:true, containerPerStageRoot:false, label:AL2-X64]])
                standardReleasePipeline.stage(Release, groovy.lang.Closure)
                   standardReleasePipeline.script(groovy.lang.Closure)
                      StandardReleasePipeline_JenkinsFile.echo(fakePublishToMaven [mavenArtifactsPath:/maven, autoPublish:true])
                standardReleasePipeline.script(groovy.lang.Closure)
                   standardReleasePipeline.postCleanup()
                      postCleanup.cleanWs({disableDeferredWipeout=true, deleteDirs=true})
                   standardReleasePipeline.sh(docker image prune -f --all)

@gaiksaya gaiksaya marked this pull request as ready for review October 13, 2022 21:29
@gaiksaya gaiksaya requested a review from a team as a code owner October 13, 2022 21:29
@gaiksaya gaiksaya marked this pull request as draft October 13, 2022 22:15
@gaiksaya
Copy link
Member Author

Thanks @prudhvigodithi , I added few more tests and removed the Libtester. Don't think it's required.

@gaiksaya gaiksaya marked this pull request as ready for review October 19, 2022 19:20
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
@prudhvigodithi
Copy link
Member

Hey @gaiksaya is it worth to add a README on how to use the vars/standardReleasePipeline.groovy file? an example in the readme?

Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
@gaiksaya
Copy link
Member Author

Hey @gaiksaya is it worth to add a README on how to use the vars/standardReleasePipeline.groovy file? an example in the readme?

Thanks for reminding @prudhvigodithi . Added the details to the readme.

@gaiksaya gaiksaya merged commit b251fcf into opensearch-project:main Oct 19, 2022
@gaiksaya gaiksaya deleted the standardPipeline branch October 19, 2022 22:52
gaiksaya added a commit that referenced this pull request Nov 4, 2022
* Add standard release pipeline library

Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
peterzhuamazon added a commit that referenced this pull request Nov 7, 2022
* Added precision for codecov (#17)

* Added precision for codecov

Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>

* Add standard release pipeline library (#11)

* Add standard release pipeline library

Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>

* Create publishToNpm library (#21)

* Add npm publishing lib

Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>

* Add standard release pipeline library with generic trigger (#22)


Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>

* Add release workflow and readme (#23)

* Add release.yml

Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>

* Fix releasing.md (#25)

Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>

Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>

* Fix credential type for github bot (#26)

* Fix credential type for github bot

Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>

* Add untriaged label to new github issues (#27)

Signed-off-by: Rishabh Singh <sngri@amazon.com>

Signed-off-by: Rishabh Singh <sngri@amazon.com>

* Remove docker check for windows gradle check (#28)

* Remove docker check for windows gradle check

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* add test results

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* Remove docker check for windows gradle check (#28)

* Remove docker check for windows gradle check

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* add test results

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* upgrade to 1.1.1 with changes in #28

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* Test results

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
Signed-off-by: Rishabh Singh <sngri@amazon.com>
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
Co-authored-by: Owais Kazi <owaiskazi19@gmail.com>
Co-authored-by: Sayali Gaikawad <61760125+gaiksaya@users.noreply.github.com>
Co-authored-by: Rishabh Singh <rishabhksingh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a function for a jenkins pipeline with defaults and basic configuration parameters
2 participants