Question

I have the following in my Phing build file:

<target name="fixModifiedTime">
    <echo msg="Fixing file modified time" />
    <exec executable="python" >
        <arg value="c:\scm\scripts\git-restore-mtime.py" />
        <arg value="-v" />
    </exec>
</target>

This is causing the following error in my Jenkins output:

[exec] Executing command: python c:\scm\scripts\git-restore-mtime.py -v 2>&1
[exec] 'python' is not recognized as an internal or external command,
[exec] operable program or batch file.

I am able to execute the same command from the Jenkins workspace directory and it works perfectly. The Python directory is added to my environment variables and the script has the right permissions.

I have also tried adding the script to my repository and running it from within the build environment but have the same error.

Any thoughts please?

Was it helpful?

Solution

I suggest the following:

  • Try creating Windows batch build step in your Jenkins and put the command in it. See if it runs
  • It's obvious your Jenkins environment is not the same is your console. See what's missing in Jenkins
  • Add the python home and path in the Jenkins configuration

I hope this helps

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top