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

Groovy script should execute with workspace dir as working directory.

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When running a groovy script the script executes with the location of the jenkins binary as working directory. I feel the execution should have the workspace directory as working directory.

        Attachments

          Activity

          Hide
          gbois Gregory Boissinot added a comment -

          I'm afraid I can't execute the Groovy script from the workspace path. However, I could add a WORKSPACE variable, accessible from your Groovy script.
          Does it suit you?

          Show
          gbois Gregory Boissinot added a comment - I'm afraid I can't execute the Groovy script from the workspace path. However, I could add a WORKSPACE variable, accessible from your Groovy script. Does it suit you?
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/java/org/jenkinsci/plugins/postbuildscript/PostBuildScriptLog.java
          src/main/java/org/jenkinsci/plugins/postbuildscript/service/ScriptExecutor.java
          http://jenkins-ci.org/commit/postbuildscript-plugin/179a31c5da73a29ccf1d4ac54d67d92ce9a6a727
          Log:
          FIx JENKINS-19326

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/java/org/jenkinsci/plugins/postbuildscript/PostBuildScriptLog.java src/main/java/org/jenkinsci/plugins/postbuildscript/service/ScriptExecutor.java http://jenkins-ci.org/commit/postbuildscript-plugin/179a31c5da73a29ccf1d4ac54d67d92ce9a6a727 Log: FIx JENKINS-19326
          Hide
          andreas_holmen_wi Andreas Holmen added a comment -

          Yes that will work for me. Thanks!

          If you are adding variables in the groovy shell the AbstractBuild object would be a very powerful object to have. Then I can do all kinds of useful stuff from a script file residing in the project SCM (rather than abusing the some other plugin that coincidentally grants access to that object from a script entered into jenkins).

          Show
          andreas_holmen_wi Andreas Holmen added a comment - Yes that will work for me. Thanks! If you are adding variables in the groovy shell the AbstractBuild object would be a very powerful object to have. Then I can do all kinds of useful stuff from a script file residing in the project SCM (rather than abusing the some other plugin that coincidentally grants access to that object from a script entered into jenkins).
          Hide
          ferrante Matt Ferrante added a comment -

          I'm adding a build variable, the AbstractBuild. PR here:
          https://github.com/jenkinsci/postbuildscript-plugin/pull/12

          Show
          ferrante Matt Ferrante added a comment - I'm adding a build variable, the AbstractBuild. PR here: https://github.com/jenkinsci/postbuildscript-plugin/pull/12

            People

            • Assignee:
              gbois Gregory Boissinot
              Reporter:
              andreas_holmen_wi Andreas Holmen
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: