What's the easiest way to make a CC.NET local trigger to execute a program? - continuous-integration

When the build fails, I'd like to execute a program that shoots me in the head with this. I've written the program already - I just need it to run when I break the build.
CCTray has the option to make a sound or icon - but not to run a file. Any simple ideas? I'd rather this not be an all day project. :)

CCTray allows you to run commands. In CCTry, go to File | Settings and then click on the Exec tab.

If you run Outlook, you can set up a rule that runs an application whenever you receive an email saying the build is broken. Just follow the rules wizard and you will find it (in Ootlook 2007 it's on the 3rd page of the wizard, in the select action part).

Cradiator has functionality to monitor build servers and do stuff when a build breaks. It doesn't have code to run an executable but it would be a cinch to download the code, change it and get what you want. Here's what I think is the quickest path to getting this done:
Download the source for Cradiator
Edit the DiscJockey.cs class
Add 1 line of code that starts your program (line 34) eg:
Configure Cradiator to monitor your build server (ie edit app.config and add your url) and run
if (newlyBrokenBuilds.Any())
{ // Add a line of code to start your program here eg
Process.Start("C:\\myprogram.exe");
}

Related

Visual Studio Post-Rebuild / Post-NoBuild Event?

I'm working on a project where I need a script to execute when someone hits "F5" or "F6", even if the code in the project hasn't changed.
The script is responsible for copying data from a different directory - data that may have changed.
I've noticed that this works properly as a post-build event, but only if the project is actually rebuilt. How do I get the event to trigger without requiring a clean each time?
These are the steps I followed to setup the script to run when I needed it:
Opened Project > Properties
Navigate to Custom Build Step > General
Put the script command in the "Command Line" field
Set an arbitrary output filename (this is required, if you don't have an output filename, visual studio will skip your custom build step) I chose an arbitrary filename ".filename" if I were to get fancy I'd also have the script output a log to this file
Set the "Execute After" field to "FinalizeBuildStatus" This ensures that the command will execute after the build status has been established (which happens in all circumstances when you'd hit F5 or F6, even if you haven't changed any code in the project).
I was surprised not to find these steps clearly outlined elsewhere online. Perhaps I'm bad at googling, but since I solved my own problem I find it only fitting to share in case someone else has this problem.

Debug second console application triggered by first console app in same solution

I have two console application projects in a single solution and they are both configured to build to a common directory. The first app calls the second app via
Process proc = new Process();
proc.StartInfo.FileName = "myprocess.exe";
I can change my startup project and debug either one of them individually just fine, but I'm unable to step into the second project from the first project. When I look in build\debug I see the .pdb files for both apps and I know the second app is running completely through its routines. I just can't step into it. I've looked at Attach to Process and Debug:Location but haven't been able to find a solution yet. I've even tried putting them in different VS solutions, but to no avail.
So I need a way to step from the first project into the second project while debugging. Any suggestions would be appreciated.
Thank you.
You can use
Debugger.Launch();
which will bring up the dialog asking if you want to attach a debugger. You won't be able to 'step in' from the existing debugging session since it's attached to a different process.

Magento Test Automation Framework

I am able to finish the installation process successfully.
Currently I am trying to run the scripts from MTAF. I am following the process and procedures mentioned in the Installation and User guide. But at the moment, I am not able to run any of the automated scripts. I am getting different messages like - "No test cases executed" / "Perhaps an error occurred. See the output window". For your reference, I have attached the main screen prints for the configurations I am using.
It would be of much help if you can point me to some person or group wherein I can get some help/directions to proceed further.
Corresponding to your setting on the 2nd screen, you have to change it from runtests.bat to path of PhpUnit execution file (../pear/phpunit.bat)
Additionally, you need specify in 'Project properties' -> 'PhpUnit configuration' -> 'Use bootstrap' + 'Use XML Configuration' references to ../mtaf/bootstrap.php and ../mtaf/phpunit.xml respectively.
It will be enough to run tests.

Debugging UDK using nFringe in Visual Studio 2005

This is a pretty niche question, so I am not expecting a huge response...
Basically, I am learning how to use the UDK by following some tutorials, namely this one:
http://forums.epicgames.com/showthread.php?p=27043379#post27043379
So far everything is going pretty well. The only real hangup I've had is getting everything to work in Visual Studio 2005 using this nFringe plugin. For a long time, couldn't get them to work at all. I've gotten into two or three chapters of the tutorial, and I've managed to use Visual Studio to edit the code, but I can't build the scripts within VS; I have to go to UDK Frontend to do that. And worse still, I can only really use Log commands in the unrealscripts to debug anything.
So my question is this: is it even possible to configure these tools in a way that I can put breakpoints in VS and have them be caught when I test the game? I feel as though I don't have something setup correctly.
Yes it is possible. Here are some info which might be useful to you.
First, both your .sln and your .ucproj files must be located in Development/src. Then, under visual studio, right-click your project (.ucproj file in the solution explorer) and open its properties.
You must set, under the General tab:
Target Game: UnrealEngine 3 Mod
UCC Path: ....\Binaries\Win32\UDK.exe
Reference Source Path: ..\Src
Under the Build tab:
check "Build debug scripts"
Under the Debug tab:
Start Game Executable: ....\Binaries\Win32\UDK.exe
Load map at startup: the name of your startup map, without path nor extension
Start with the specified game type: put your GameInfo class used for your mod, ie. MyMod.MyGameInfo
Disable startup movies can be checked to gain time at launch
Enable unpublished mods must be checked.
In your command line, the parameter -vadebug specifies that the breakpoints will be enabled.
After that, you must be able to build your script from Visual, and launch your game by pressing F5.
Breakpoints should work but you can't put them on a variable declaration, you have to put them on a function call, an assignment or a condition statement.
Hope this will help.
I havnt tried using breakpoints yet but I know its possable to build with nfringe and visual studio . You need to add a line to the
udk game / config / udk engine .ini
search for
editpackages
exactly like that , then youll see a block like this
EditPackagesInPath=....\Development\Src
EditPackages=Core
EditPackages=Engine
EditPackages=GFxUI
EditPackages=GameFramework
EditPackages=UnrealEd
EditPackages=GFxUIEditor
EditPackages=IpDrv
EditPackages=OnlineSubsystemPC
EditPackages=OnlineSubsystemGameSpy
EditPackages=OnlineSubsystemLive
EditPackages=OnlineSubsystemSteamworks
then add your own line pointing to a folder named what ever you want but make sure it has a folder in it named Classes and it has the uc files you wnat to compile in it
ModEditPackages=MyTestProject
if you used that line then you are tellign udk you have a folder named
MyTestProject
located in your development/src folder and you want it to compile everything in there

How to lock "Run" button in TeamCity

I made a build in TeamCity which deploys code to live server. As a precaution I want to disable that button "run" can be clicked by mistake.So I want to have an additional level of checking "whether I'm sure" I want to click "run" button. Is it possible to accomplish?
Thanks in advance!
I don't think there is a way to disable the run button.
An approach I've used is to have a Property which gets passed to the build script which needs to be true for the script to run, it's false or not set then the build script throws an error. Then in the build configuration on the Properties & Environment Variables page I set the property to false. Now whenever I need to run the script I have to use the "Run custom build" button (the "| ..." bit beside the run button), then I set the value to true before hitting the build button.
Another, easier option, is to add a agent requirement to your build such that only the production server's agent can meet it (e.g. env.COMPUTERNAME equals MyProductionServer01), and then disable the agent with a note about "locking" the production build. This will prevent the build from actually running if you accidentally click the Run button.
You cannot disable the run button but you can set permissions so that people are still able to view the project without the ability to run it (specifically the Run Build role).
As far as the confirmation goes there is nothing built into TeamCity to accomplish this but I do believe it would be possible to write a small plugin to gain this type of functionality.
Plugin Information:
http://confluence.jetbrains.net/display/TCD6/Developing+TeamCity+Plugins
Indeed, there is no ability to hide Run button unless the build configuration is placed in a different project, which user has no permission to run builds in.
There is a related feature request in TeamCity issue tracker.
As to requesting confirmation, there is still no direct support, but since TeamCity 7.0 one may add a parameter with mode "prompt" and this will result in the run custom build dialog popping out on Run button click.
We have solved this by providing double log-ins for our users. The normal user is not having permisson to run dangerous projects, but if the log in as elevated.user they have access to the run button for these projects as well.
So in normal situations there is no risk of running by accident.
I don't think there is disable button for run. You can pause the build and run it when you want to deploy to live sever.
Not that I'm aware of. If you have enterprise you could set it up so that there is a special account which has permissions to execute that build. Another workaround would be to make the build look at a specific branch in your SCM repo with restricted permissions, etc. Typically merging to a branch requires a bit of effort so its not as easy as hitting run by accident. Also ensures that someone hitting run won't necessarily grab the latest unstable copy from the trunk or somesuch.
You can now remove the Run button by adding teamcity.ui.runButton.caption parameter with an empty value.
See this comment on YouTrack.

Resources