Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-27424

Expose the current Jenkins job to the Groovy script

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      quoted from https://github.com/jenkinsci/groovy-label-assignment-plugin/pull/1:

      in your groovy script, you can reference the current Jenkins job as “currentJob” and do stuff like that:

      [‘windows’, ‘linux’, ‘mac’].find { currentJob.name.toLowerCase().contains(it) }
      

      The piece of code above would automatically assign the label according to the job name.

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            src/main/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentProperty.java
            http://jenkins-ci.org/commit/groovy-label-assignment-plugin/9b780e3e3aefeaf5631facc920487af04403f545
            Log:
            Merge pull request #1 from greg2001/master

            [FIXED JENKINS-27424] Expose the current Jenkins job to the Groovy script as "currentJob" variable

            Compare: https://github.com/jenkinsci/groovy-label-assignment-plugin/compare/3fbdd41088f4...9b780e3e3aef

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentProperty.java http://jenkins-ci.org/commit/groovy-label-assignment-plugin/9b780e3e3aefeaf5631facc920487af04403f545 Log: Merge pull request #1 from greg2001/master [FIXED JENKINS-27424] Expose the current Jenkins job to the Groovy script as "currentJob" variable Compare: https://github.com/jenkinsci/groovy-label-assignment-plugin/compare/3fbdd41088f4...9b780e3e3aef
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            src/test/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentJenkinsRule.java
            src/test/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentPropertyJenkinsTest.java
            http://jenkins-ci.org/commit/groovy-label-assignment-plugin/2e5c53873eec242ae270f3743c2922ce4e202e09
            Log:
            JENKINS-27424 Added tests for currentJob feature.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/test/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentJenkinsRule.java src/test/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentPropertyJenkinsTest.java http://jenkins-ci.org/commit/groovy-label-assignment-plugin/2e5c53873eec242ae270f3743c2922ce4e202e09 Log: JENKINS-27424 Added tests for currentJob feature.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            src/main/resources/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentProperty/help-groovyScript.html
            src/main/resources/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentProperty/help-groovyScript_ja.html
            http://jenkins-ci.org/commit/groovy-label-assignment-plugin/ef071a8a94299d5907ed449c73f85da56565b5c5
            Log:
            JENKINS-27424 Updated help texts. Added a description for currentJob.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/resources/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentProperty/help-groovyScript.html src/main/resources/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentProperty/help-groovyScript_ja.html http://jenkins-ci.org/commit/groovy-label-assignment-plugin/ef071a8a94299d5907ed449c73f85da56565b5c5 Log: JENKINS-27424 Updated help texts. Added a description for currentJob.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            pom.xml
            src/main/resources/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentProperty/help-groovyScript.html
            src/main/resources/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentProperty/help-groovyScript_ja.html
            src/test/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentJenkinsRule.java
            src/test/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentPropertyJenkinsTest.java
            http://jenkins-ci.org/commit/groovy-label-assignment-plugin/3abb68096f79c6e248985db4fecf7ab0f1246767
            Log:
            Merge pull request #2 from ikedam/feature/JENKINS-27424_TestsForCurrentJob

            JENKINS-27424 Added tests for currentJob

            Compare: https://github.com/jenkinsci/groovy-label-assignment-plugin/compare/9b780e3e3aef...3abb68096f79

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: pom.xml src/main/resources/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentProperty/help-groovyScript.html src/main/resources/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentProperty/help-groovyScript_ja.html src/test/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentJenkinsRule.java src/test/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentPropertyJenkinsTest.java http://jenkins-ci.org/commit/groovy-label-assignment-plugin/3abb68096f79c6e248985db4fecf7ab0f1246767 Log: Merge pull request #2 from ikedam/feature/ JENKINS-27424 _TestsForCurrentJob JENKINS-27424 Added tests for currentJob Compare: https://github.com/jenkinsci/groovy-label-assignment-plugin/compare/9b780e3e3aef...3abb68096f79
            Hide
            ikedam ikedam added a comment -

            Released groovy-label-assignment-1.1.0.
            It will be available in a day.

            Show
            ikedam ikedam added a comment - Released groovy-label-assignment-1.1.0. It will be available in a day.

              People

              • Assignee:
                ikedam ikedam
                Reporter:
                ikedam ikedam
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: