Jenkins P4 changelist help

275 views
Skip to first unread message

Benjam901

unread,
Aug 11, 2017, 8:31:23 AM8/11/17
to Python Programming for Autodesk Maya

Hello all,

I am having trouble with my Jenkins build at the moment. I have successfully set it up so that the P4 polling SCM is working correctly on my specified directories which is good but the snag is getting the changelists out into a separate build script.

Here is my proposed workflow:
Poll every minute checking for changes in specified P4 dirs.
If changes are found run build and gather changelists.
Pass changelists to new build that runs python script to filter and run processes on files etc.

The snag:
The image below shows the summary of changes, I would like to be able to get all changelist numbers and pass them to my python filtering script.
I have tried using P4_CHANGELIST in my console execution but it only returns the latest change not all three as the image below illustrates.

Cheers,

Ben

yury nedelin

unread,
Aug 11, 2017, 9:31:13 PM8/11/17
to python_in...@googlegroups.com
P4 will create an xml file with full sync log for each build. Look for it in Jenkins root. I will send you exact location later after I get in front of a computer if you can not find it.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1b05f7ba-5881-4794-8c9c-a8d02edbacd9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Benjam901

unread,
Aug 14, 2017, 11:52:16 AM8/14/17
to Python Programming for Autodesk Maya
I found the file in question "C:/Program Files (x86)/Jenkins/jobs/publish_package_on_p4_check_in/builds/changelog.xml" and have set up my process to iterate files in the changelists found in this file, my process polls every minute checking for changes.

I then run a post build job based on if Maya files are found in any changelist I then exit with an exit code that triggers a post build script.

My post build script runs a new batch process that is supposed to boot Maya and pass in a script to run on boot but I cannot get Jenkins to run Maya. It get to the execution line and just hangs until I kill the process, is there a way to sucessfully boot a window exe like Maya through Jenkins? I feel I may be missing something.

Cheers,

Ben

yury nedelin

unread,
Aug 14, 2017, 12:22:35 PM8/14/17
to python_in...@googlegroups.com
Can you start Maya from command prompt manually, without Jenkins? If not what is the error you get , if you get one?


To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

Ben Hearn

unread,
Aug 14, 2017, 1:53:21 PM8/14/17
to python_in...@googlegroups.com
Yes I have usually been able to start Maya from command prompt our whole system runs on this type of thing. I shall run a manual test with my newer trimmed down jenkins boot and see what happens.

- Ben

--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/eT12eQChWJo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CACqGScj%2BLZJw3r2wEA7Wc1q5PZz24-AeTr4jDk4Ja8u1uTCE%3DQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--

Tel - +46 76245 92 90 (Sweden)

Benjam901

unread,
Aug 15, 2017, 5:04:44 AM8/15/17
to Python Programming for Autodesk Maya
I fixedMy Maya batch file runs correctly and the script passed into it runs correctly when I run standalone without Jenkins but with Jenkins i

This is my call to boot Maya:
"start "" "C:\Program Files\Autodesk\Maya%MAYA_VERSION%\bin\maya.exe" "-script" %TOOLSPATH%\standalone\sb_package_browser\execute.mel"

The console output from my Jenkins build is below:
C:\Program Files (x86)\Jenkins\workspace\publish_package_on_p4_check_in>start "" "C:\Program Files\Autodesk\Maya2017\bin\maya.exe" "-script" D:\p4sb\Trunk\ContentTools\asset_tools\DEV\standalone\sb_package_browser\execute.mel 

C:\Program Files (x86)\Jenkins\workspace\publish_package_on_p4_check_in>exit 0
Process leaked file descriptors. See https://jenkins.io/redirect/troubleshooting/process-leaked-file-descriptors for more information POST BUILD TASK : SUCCESS END OF POST BUILD TASK : 0
Finished: SUCCESS

As you can see the process completes but Maya does not boot and the actual Maya process does not boot. I remember reading somewhere that you must set BUILD_ID=do not kill, however this has not been sucessful for me. 

I would assume that because I am trying to kick off an entirely new exe process Jenkins does not recognise that it needs to wait and simply falls through?

- Ben
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/eT12eQChWJo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CACqGScj%2BLZJw3r2wEA7Wc1q5PZz24-AeTr4jDk4Ja8u1uTCE%3DQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

Justin Israel

unread,
Aug 15, 2017, 5:12:50 AM8/15/17
to Python Programming for Autodesk Maya
I know very little about Windows command workflows, but is the "start" command the appropriate thing here? Its documented as trying to launch a new command prompt window to run the app, which implies an async launch and also probably not appropriate for Jenkins. Does it only work if you use that "start" command? If so, can you try those documented flags:   /b /wait
That seems to tell it to not launch a new command prompt and to wait for the process to end, which is what you want.

Justin


To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/eT12eQChWJo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.



--

Tel - +46 76245 92 90 (Sweden)

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/98cd6c9d-d2e4-4aaa-bcdb-0a5da68dc7ec%40googlegroups.com.

Benjam901

unread,
Aug 15, 2017, 5:38:03 AM8/15/17
to Python Programming for Autodesk Maya
No dice I am afraid on the wait command. I can change it so it is written in the Jenkins Unix shell but I am unsure how to do this at current. Would the problem I am having not be the same though? Or would the shell allow me greater flexibility?

Have you managed to launch a separate Maya process through web Jenkins before?

- Ben
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/eT12eQChWJo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.



--

Tel - +46 76245 92 90 (Sweden)

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

Benjam901

unread,
Aug 15, 2017, 7:15:02 AM8/15/17
to Python Programming for Autodesk Maya
I experimented and tried to move towards using more of a pythonic approach running Maya and the relevant scripts through subprocess like so:

cmd = ['C:/Program Files/Autodesk/Maya2017/bin/maya.exe', '-script', melScript]
print cmd
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output, stderr = p.communicate() # Wait for the maya process to finish

However the process still hangs and Maya does not boot am I missing something?

Justin Israel

unread,
Aug 15, 2017, 3:29:32 PM8/15/17
to Python Programming for Autodesk Maya


On Tue, Aug 15, 2017, 9:38 PM Benjam901 <benandr...@gmail.com> wrote:
No dice I am afraid on the wait command. I can change it so it is written in the Jenkins Unix shell but I am unsure how to do this at current. Would the problem I am having not be the same though? Or would the shell allow me greater flexibility?

Have you managed to launch a separate Maya process through web Jenkins before?

Yes we have tests that run on Jenkins that include launching a Maya process. But you do need to make sure it isn't trying to launch a detached process/shell. It needs to launch a regular subprocess child that it waits for. 

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/eT12eQChWJo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.



--

Tel - +46 76245 92 90 (Sweden)

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1a00a6d4-684c-4f1e-a626-8d8c199fc7cb%40googlegroups.com.

Ben Hearn

unread,
Aug 15, 2017, 4:32:44 PM8/15/17
to python_in...@googlegroups.com
I figured it out in the end, I was not aware that I had to set my computer up as a slave and have Jenkins run the process on the slave. The process was actually running before but it was silent in the background. I set it up and Maya and Notepad etc. now boot correctly in the foreground

That took me a while to figure out and there were some options that were not default enabled that I needed, I am going to write this one up I think. Help out the next guy who has that issue.

- Ben

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/eT12eQChWJo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.



--

Tel - +46 76245 92 90 (Sweden)

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/eT12eQChWJo/unsubscribe.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages