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

Environment variables not being parsed in Phing Build File field

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: phing-plugin
    • Labels:
      None
    • Environment:
      Hudson 1.392, Phing Plugin 0.6.1
    • Similar Issues:

      Description

      When using an environment variable to give a more specific location of a Phing build file, such as $BRANCH_DIR, the plugin is not parsing the environment variable. Because of this, it attempts to load the literal "$BRANCH_DIR/build.xml" and append it onto the workspace path. This is not the expected behavior since using the exact same method with the Ant task does parse and expand the variable correctly.

      Example input on job configuration:

      Invoke Phing targets
      – Targets: stage deploy
      – Phing Build File: $WORKSPACE/build.xml

      Example output when built:

      [$WORKSPACE] $ phing -buildfile build.xml stage deploy -logger phing.listener.DefaultLogger
      FATAL: command execution failed.Maybe you need to configure the job to choose one of your Phing installations?
      java.io.IOException: Cannot run program "phing" (in directory "/usr/local/hudson/workspace/job_1/$WORKSPACE"): java.io.IOException: error=2, No such file or directory

        Attachments

          Activity

          Hide
          sogabe sogabe added a comment -

          This plugin does not parse environment variables in build.xml. it only parse file field.

          Show
          sogabe sogabe added a comment - This plugin does not parse environment variables in build.xml. it only parse file field .
          Hide
          rogerwebb Roger Webb added a comment -

          I have tried ${BUILD_DIR} and $BUILD_DIR in the mkdir tag:

          <mkdir dir="${BUILD_DIR}/reports" />

          This creates a directory literally called "${BUILD_DIR}/reports" in my "workspace" directory.
          (same for $BUILD_DIR)

          Using Phing plubin 0.8 with Phing 2.4.6

          Show
          rogerwebb Roger Webb added a comment - I have tried ${BUILD_DIR} and $BUILD_DIR in the mkdir tag: <mkdir dir="${BUILD_DIR}/reports" /> This creates a directory literally called "${BUILD_DIR}/reports" in my "workspace" directory. (same for $BUILD_DIR) Using Phing plubin 0.8 with Phing 2.4.6
          Hide
          sogabe sogabe added a comment -

          Fixed in 0.7

          Show
          sogabe sogabe added a comment - Fixed in 0.7

            People

            • Assignee:
              sogabe sogabe
              Reporter:
              genetik genetik
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: