add the extra stuff from buildbot/test/* so unit tests will run on installed copies...
[buildbot.git] / contrib / windows / buildbot2.bat
blobe211adc79c78804efd98e64c5970035d0a8da545
1 @echo off\r
2 rem This is Windows helper batch file for Buildbot\r
3 rem NOTE: You will need Windows NT5/XP to use some of the syntax here.\r
4 \r
5 rem Please note you must have Twisted Matrix installed to use this build system\r
6 rem Details: http://twistedmatrix.com/ (Version 1.3.0 or more, preferrably 2.0+)\r
7 \r
8 rem NOTE: --reactor=win32 argument is need because of Twisted\r
9 rem The Twisted default reactor is select based (ie. posix) (why?!)\r
11 rem Keep environmental settings local to this file\r
12 setlocal\r
14 rem Change the following settings to suite your environment\r
16 rem This is where you want Buildbot installed\r
17 set BB_DIR=z:\Tools\PythonLibs\r
19 rem Assuming you have TortoiseCVS installed [for CVS.exe].\r
20 set CVS_EXE="c:\Program Files\TortoiseCVS\cvs.exe"\r
22 rem Trial: --spew will give LOADS of information. Use -o for verbose.\r
23 set TRIAL=python C:\Python23\scripts\trial.py -o --reactor=win32\r
24 set BUILDBOT_TEST_VC=c:\temp\r
26 if "%1"=="helper" (\r
27         goto print_help\r
28 )\r
30 if "%1"=="bbinstall" (\r
31         rem You will only need to run this when you install Buildbot\r
32         echo BB: Install BuildBot at the location you set in the config:\r
33         echo BB: BB_DIR= %BB_DIR%\r
34         echo BB: You must be in the buildbot-x.y.z directory to run this:\r
35         python setup.py install --prefix %BB_DIR% --install-lib %BB_DIR%\r
36         goto end\r
37 )\r
39 if "%1"=="cvsco" (\r
40         echo BB: Getting Buildbot from Sourceforge CVS [if CVS in path].\r
41         if "%2"=="" (\r
42                 echo BB ERROR: Please give a root path for the check out, eg. z:\temp\r
43                 goto end\r
44         )\r
46         cd %2\r
47         echo BB: Hit return as there is no password\r
48         %CVS_EXE% -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/buildbot login \r
49         %CVS_EXE% -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/buildbot co -P buildbot \r
50         goto end\r
51 )\r
53 if "%1"=="cvsup" (\r
54         echo BB: Updating Buildbot from Sourceforge CVS [if CVS in path].\r
55         echo BB: Make sure you have the project checked out in local VCS.\r
56         \r
57         rem we only want buildbot code, the rest is from the install\r
58         cd %BB_DIR%\r
59         echo BB: Hit return as there is no password\r
60         %CVS_EXE% -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/buildbot login \r
61         %CVS_EXE% -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/buildbot up -P -d buildbot buildbot/buildbot\r
62         goto end\r
63 )\r
65 if "%1"=="test" (\r
66         rem Trial is a testing framework supplied by the Twisted Matrix package.\r
67         rem It installs itself in the Python installation directory in a "scripts" folder,\r
68         rem e.g. c:\python23\scripts\r
69         rem This is just a convenience function because that directory is not in our path.\r
70                 \r
71         if "%2" NEQ "" (\r
72                 echo BB: TEST: buildbot.test.%2\r
73                 %TRIAL% -m buildbot.test.%2\r
74         ) else (\r
75                 echo BB: Running ALL buildbot tests...\r
76                 %TRIAL% buildbot.test\r
77         )\r
78         goto end\r
79 )\r
81 rem Okay, nothing that we recognised to pass to buildbot\r
82 echo BB: Running buildbot...\r
83 python -c "from buildbot.scripts import runner; runner.run()" %*\r
84 goto end\r
86 :print_help\r
87 echo Buildbot helper script commands:\r
88 echo    helper          This help message\r
89 echo    test            Test buildbot is set up correctly\r
90 echo Maintenance:\r
91 echo    bbinstall       Install Buildbot from package\r
92 echo    cvsup           Update from cvs\r
93 echo    cvsco [dir]     Check buildbot out from cvs into [dir]\r
95 :end\r
96 rem End environment scope\r
97 endlocal\r