[JIRA] (JENKINS-38110) Library section within declarative syntax to explicitly load shared libraries
Title: Message Title Liam Newman closed an issue as Fixed Bulk closing resolved issues. Jenkins / JENKINS-38110 Library section within declarative syntax to explicitly load shared libraries Change By: Liam Newman Status: Resolved Closed Add Comment This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.174264.1473441743000.17673.1571801069069%40Atlassian.JIRA.
[JIRA] (JENKINS-38110) Library section within declarative syntax to explicitly load shared libraries
Title: Message Title Andrew Bayer updated JENKINS-38110 Jenkins / JENKINS-38110 Library section within declarative syntax to explicitly load shared libraries Change By: Andrew Bayer Status: In Review Resolved Resolution: Fixed Add Comment This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38110) Library section within declarative syntax to explicitly load shared libraries
Title: Message Title SCM/JIRA link daemon commented on JENKINS-38110 Re: Library section within declarative syntax to explicitly load shared libraries Code changed in jenkins User: Andrew Bayer Path: pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTLibraries.java pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTPipelineDef.java pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidator.java pipeline-model-api/src/main/resources/ast-schema.json pipeline-model-definition/pom.xml pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Libraries.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Root.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/JSONParser.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/ModelParser.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidatorImpl.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ClosureModelTranslator.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/LibrariesTranslator.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/Messages.properties pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/BasicModelDefTest.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ValidatorTest.java pipeline-model-definition/src/test/resources/errors/emptyLibrariesDirective.groovy pipeline-model-definition/src/test/resources/errors/invalidLibrariesDirectiveContent.groovy pipeline-model-definition/src/test/resources/librariesDirective.groovy pom.xml http://jenkins-ci.org/commit/pipeline-model-definition-plugin/0c7d4fdadd4ad3b2a749853a3bb3eee567c54ae6 Log: Merge pull request #128 from abayer/jenkins-38110 JENKINS-38110 Add a libraries section Compare: https://github.com/jenkinsci/pipeline-model-definition-plugin/compare/4c9b7e24b846...0c7d4fdadd4a Add Comment
[JIRA] (JENKINS-38110) Library section within declarative syntax to explicitly load shared libraries
Title: Message Title SCM/JIRA link daemon commented on JENKINS-38110 Re: Library section within declarative syntax to explicitly load shared libraries Code changed in jenkins User: Andrew Bayer Path: pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTLibraries.java pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTPipelineDef.java pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidator.java pipeline-model-api/src/main/resources/ast-schema.json pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Libraries.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Root.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/JSONParser.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/ModelParser.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidatorImpl.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ClosureModelTranslator.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/LibrariesTranslator.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/Messages.properties pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/91d361bb30134b79fdf6ed4089e7cd110008c289 Log: JENKINS-38110 Add a libraries section Note that this is very preliminary at this point - like, it doesn't actually call the library step yet, since we don't yet have a release of workflow-cps-global-lib-plugin with that included to depend on. We also don't have parsing tests or any of that jazz. But that's ok. Add Comment This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
[JIRA] (JENKINS-38110) Library section within declarative syntax to explicitly load shared libraries
Title: Message Title Andrew Bayer updated JENKINS-38110 Jenkins / JENKINS-38110 Library section within declarative syntax to explicitly load shared libraries Change By: Andrew Bayer Status: In Progress Review Add Comment This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38110) Library section within declarative syntax to explicitly load shared libraries
Title: Message Title Andrew Bayer commented on JENKINS-38110 Re: Library section within declarative syntax to explicitly load shared libraries Very early work-in-progress PR up at https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/128 Add Comment This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38110) Library section within declarative syntax to explicitly load shared libraries
Title: Message Title Andrew Bayer started work on JENKINS-38110 Change By: Andrew Bayer Status: Open In Progress Add Comment This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38110) Library section within declarative syntax to explicitly load shared libraries
Title: Message Title Dominik Bartholdi commented on JENKINS-38110 Re: Library section within declarative syntax to explicitly load shared libraries Peter Leibiger see JENKINS-40642 Add Comment This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38110) Library section within declarative syntax to explicitly load shared libraries
Title: Message Title Peter Leibiger commented on JENKINS-38110 Re: Library section within declarative syntax to explicitly load shared libraries Actually this works as well. Until 0.4 it worked without the import, now it doesn't. @org.jenkinsci.plugins.workflow.libs.Library('foo@master') import foo.Util // doesn't work anymore // def util = new foo.Util() def util = new Util() Add Comment This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38110) Library section within declarative syntax to explicitly load shared libraries
Title: Message Title Peter Leibiger edited a comment on JENKINS-38110 Re: Library section within declarative syntax to explicitly load shared libraries Not sure if this is the right issue but there are probably some things to consider for this issue.Up until version 0.4 I was able to use {{@Library}} like this:{code}@Library('foo@master')def util = new foo.Util()timestamps { pipeline {agent docker: 'maven:3-jdk-8'stages { stage('Pre-Build') {util.doSomething() } // more stages}notifications { success {util.notifyBuildStatusSuccess() } ...}}{code} Now with 0.4 it fails to find the {{@Library}} annotation, I can work around by using the FQN.But I can't get a single {{Util}} instance to work anymore, best I came up with is this: {code}@ org.jenkinsci.plugins.workflow.libs. Library('foo@master')import foo.Util// timestamps don't work anymore//timestamps { pipeline {agent docker: 'maven:3-jdk-8'stages { stage('Pre-Build') {script { def util = new Util() util.doSomething()} } // more stages}notifications { success {script { def util = new Util() util.notifyBuildStatusSuccess()} } ...} }//}{code}I tried putting the {{Util}} in {{environment}} but that throws {{sandbox.RejectedAccessException}}:{code}@ org.jenkinsci.plugins.workflow.libs. Library('foo@master')import foo.Util// timestamps don't work anymore//timestamps { pipeline {agent docker: 'maven:3-jdk-8'environment { util = new Util()}stages { stage('Pre-Build') {script { env.util.doSomething()} } // more stages}notifications { success {script { env.util.notifyBuildStatusSuccess()} } ...} }//}{code} Add Comment This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
[JIRA] (JENKINS-38110) Library section within declarative syntax to explicitly load shared libraries
Title: Message Title Peter Leibiger commented on JENKINS-38110 Re: Library section within declarative syntax to explicitly load shared libraries Not sure if this is the right issue but there are probably some things to consider for this issue. Up until version 0.4 I was able to use @Library like this: @Library('foo@master') def util = new foo.Util() timestamps { pipeline { agent docker: 'maven:3-jdk-8' stages { stage('Pre-Build') { util.doSomething() } // more stages } notifications { success { util.notifyBuildStatusSuccess() } ... } } Now with 0.4 it fails to find the @Library annotation, I can work around by using the FQN. But I can't get a single Util instance to work anymore, best I came up with is this: @Library('foo@master') import foo.Util // timestamps don't work anymore //timestamps { pipeline { agent docker: 'maven:3-jdk-8' stages { stage('Pre-Build') { script { def util = new Util() util.doSomething() } } // more stages } notifications { success { script { def util = new Util() util.notifyBuildStatusSuccess() } } ... } } //} I tried putting the Util in environment but that throws sandbox.RejectedAccessException: @Library('foo@master') import foo.Util // timestamps don't work anymore //timestamps { pipeline { agent docker: 'maven:3-jdk-8' environment { util = new Util() } stages { stage('Pre-Build') { script { env.util.doSomething() } } // more stages } notifications { success { script { env.util.notifyBuildStatusSuccess() } } ... } } //} Add Comment
[JIRA] (JENKINS-38110) Library section within declarative syntax to explicitly load shared libraries
Title: Message Title Patrick Wolf created an issue Jenkins / JENKINS-38110 Library section within declarative syntax to explicitly load shared libraries Issue Type: New Feature Assignee: Andrew Bayer Components: pipeline-model-definition-plugin Created: 2016/Sep/09 5:22 PM Priority: Minor Reporter: Patrick Wolf Right now users must use an @Library annotation to load libraries in Pipeline script. This works within a Pipeline with declarative syntax but must be called outside of the pipeline block. It would be nice if we could load libraries within the pipeline block with a library configuration section. Add Comment