Sign In or Register
Not Registered Yet?

Join Now! It's FREE. Get full access and benefit from this site

Reset My password - Remind Me My username

Remember me
× Python Script

Perforce Python Script Collection.

2 years 7 months ago - 2 years 7 months ago #2239 by rajeshkumar
rajeshkumar created the topic: Perforce Python Script Collection.
Implement a script that will do following:

1. Read config file. This file will contain following settings:
a. For mail delivery (SMTP)
b. For access to perforce server
2. Get from perforce a list of changes made since last script run time and get all updated files
3. Invoke script that will ‘build’ the changes – it will be located in the working folder of the
script(build.bat/build.sh). Script itself should come from perforce as well during step 2.
4. If running of build script is successful, add/update contents of folder named ‘bin’ in the perforce
repository (it is expected that build script will put there a product of its work)
5. In case of error of invocation, send out an email with the list of changes retrieved in p.2 and all outputs of
build script (both stdout/stderr), in which case contents of ‘bin’ folder should not be updated to perforce

Script details:
master.py – This file is the main file which should be excuted to get the all desired output as per the task
build.bat – This is a Build file which will be executing during compilation phase in master.py. config.ini: Following key should be modified as the environment specification

Scenario to create fail Build:
Remove comment line from “REM mkdir raj” in build.bat

How to use?
Change the config.ini file appropriately and fire master.py script. If you find any issues, please follow the log error message accordingly.

File is as attached

File Attachment:

File Name: build.bat.txt
File Size:0 KB

File Attachment:

File Name: config.ini.txt
File Size:0 KB

File Attachment:

File Name: Index.txt
File Size:0 KB

File Attachment:

File Name: master.txt
File Size:4 KB

Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Please Log in to join the conversation.

Time to create page: 0.406 seconds