Can't understand how to run build
Hello!
I can't understand how to do incremental build (every hour for example) or just simple build via Rational Team Concern Jazz Express-C. 1. Visual Studio 2008 with Jazz client on WinXP64bit. 2. RTC installed on Suse 10 Server. Database running on DB2 Express-C 9.7 3. I want run build on Windows machine (Windows Server 2003), cause project is .NET framework. Thanks. :D |
5 answers
Hello! Hi There are a few things you need to do: 1) Create a build for your code. Use the commandline build capabilities in Visual Studio. 2) Use the Ant tasks to report back info to the RTC Build results 3) Set up the build in RTC so it calls your build script. The Help system in RTC tells you more about 2) and 3). I recall Jean-Michel created an article or blog entry on Visual Studio builds - it should be here on jazz.net. anthony |
On 2/13/2010 12:08 PM, Danny wrote:
Hello! Do you have any specific problem? Or just a generic question... if your case is the last, try taking a look to this chapter of RTC Tutorial: http://publib.boulder.ibm.com/infocenter/rtc/v2r0m0/index.jsp?topic=/com.ibm.team.concert.tutorial.doc/topics/tut_rtc_build.html Hope it helps, Chemi. |
Hi
Don't think attachments will make it to the forum so I'm pasting the content of a short HOWTO I wrote that describes on one way to setup VS builds with RTC that uses https://jazz.net/wiki/bin/view/Main/BuildExamples as a starting point and as a template for the example: This example demonstrates how to setup a very simple Jazz-based Microsoft Visual Studio build. The buildtoolkit tasks are written in java as Ant tasks. This means in order to execute the tasks, your build machine will need to have a java VM available. * Create a build definition and build engine * Create a batch file that invokes msbuild/devenv on a Visual Studio Solution, including Setup and Deployment projects * Use the buildtoolkit tasks from the batch file for progress monitoring, artifact/file publishing * Labelling the build with the Visual Studio Solution's AssemblyVersion for easy build tracking once the build results are deployed * Run the Jazz Build Engine * Request a build, including changing properties on demand to invoke different target/build/configuration builds * View the build result * You have an existing Visual Studio solution in Jazz SCM that builds cleanly. The example uses some parts of http://msdn.microsoft.com/en-us/library/ms404859.aspx to create a sample Visual Studio Solution. * You've installed the Team Concert client for Visual Studio and the Team Concert Eclipse client (required to create/manage the build definitions and engine) * You've installed the Build System Toolkit (on your machine or another build machine) * From your Team Concert clients, you are able to login to a Jazz Team Server where you are a member of an existing project and team area * The build batch file will need access to a Java VM and Ant. For this example, you can use the ones that are part of the Team Concert client. In a real setup, you'll need them installed on your build machine. * The team area has a user "build" with password "build" that will be used to run the build engine * Start the Team Concert Eclipse client. Login and connect to your project area * Go to the Team Artifacts view, expand the project area * Right-click the Builds node, New Build Definition * Select the project/team area to associate with the build * Click Next * Type an ID for the build definition, such as "vsbuild" (without the quotes) * Select the "Command Line - Jazz Build Engine" template * Click Next * Select "Jazz Source Control" * Click Finish * The build definition editor will open * On the General page, in the Supporting Build Engines section, click Create Engine, type an engine ID such as "vsbuildengine1" * On the Jazz Source Control page, in the Workspace field click the Create button and create a workspace "VS Build Workspace" flowing with the stream your Visual Studio Solution is developed in and assigning the "build" user as the workspace owner. * On the Jazz Source Control page, in the Load directory field enter "c:\vsbuild" without the quotes. * On the Command Line page, in the Command field, enter the command "cmd /c build.bat" without the quotes. * On the Command Line page, in the Arguments field, enter "${repositoryAddress} ${buildResultUUID} ${projectorsetup} ${target} ${config}" without the quotes * On the Command Line page, in the Working directory field, enter the directory containing the Visual Studio Solution to be built * On the properties page add the following properties: * Save the definition * You've just created a Jazz build definition for a command line build * Leave the definition editor open, we'll come back to it later * In the same directory as your Visual Studio Solution create a file called "
Note that you will need to modify the following in the above batch file to suit your particular configuration: CLASSPATH The buildtoolkit contains several Ant tasks that are helpful in creating a richer build experience in Team Concert. For example, you can enable fine-grained progress monitoring by using the startBuildActivity task, and publish build logs and artifacts using the logPublisher and artifactLinkPublisher tasks. A buildtoolkit Ant task reference can be found in the Team Concert help. Your Visual Studio builds can take advantage of these tasks by adding targets to the batch file that invoke Ant. We'll demonstrate calling the startBuildActivity, a number of publisher tasks, including changing the build label to a custom label (versionLabel in the build.bat) from the batch file. * Create a file named
Before you can run builds, you must start the Jazz Build Engine. If you don't start the build engine, your build requests will just sit forever in the build queue. Typically, the build engine runs on a dedicated remote build machine. However, for this example, you can run it on your local machine. * Open a command prompt or shell * cd to installdir/buildsystem/buildengine/eclipse * jbe -repository address -userId build -pass build -engineId vsbuildengine1 -sleeptime 1 Notice how the -engineId argument matches the build engine ID created during the setup. The build engine should have printed a message like "Waiting for request..." Now that the build engine is ready to process requests, you can request a build in the Team Concert UI. Or setup a schedule for CI. * In the definition editor header, click the Request Build button * In the Request Build dialog, click Submit * The Builds view will be automatically shown at the bottom of the Team Concert window. You should see your build there. You can refresh the Builds view to track progress of the build. * Once the build is completed, double-click your build. The build result editor will open. * In the Contribution Summary section, you should see a link for "1 log". Clicking the link takes you to the Logs page. * Double-click the log to open it and examine the output of the build command * There will be an Activities page where you can see the "compiling..." and "publishing..." activities that were created by invoking the corresponding targets from the batchfile * There will be a "Downloads" page with a URL and a file download available * There will be an External Links page with an external link URL * You can use this pattern to add other buildtoolkit tasks to your batchfile Hopefully, you were able to follow this example to get the sample build running. This is a quick way to get a Jazz-based build up and running for your team. You'll get build progress monitoring, events, and result viewing for very little setup cost. A few additional notes on the above: * You can change which target/solution/configuration is built by changing the value of the corresponding property when requesting the build * Note that "Running the build" section can be performed from the Visual Studio client or even the Web * Passing the build definition properties in the command line to the ant-launcher call seems a bit unwieldy. The alternative is to turn this inside out ie. use a proper Jazz Ant build and invoke msbuild/devenv as an Ant Exec task; this would make using the properties easier but I didn't have the time to work out how to make sure the environment gets properly set using vcvars. In many cases, you only need to pass values to the Ant task, as shown in the example above. Sometimes, however, you will need to get values produced by the task from Ant back into your calling script. One way to do this is to store the values into properties in Ant, and write the properties to a file. Then, the calling script can parse the properties file and get the values. If parsing a properties file is not possible from the calling environment, then some of the task functionality will not be available to your build. Example of creating a properties file containing the "activityId" value output from Ant:
After your script invokes Ant, there will be a "my.properties" file that your script can parse and get the value of the activityId. HTH Regards Freddy |
|
How do You suggest to run a step/script before/after the build in the above setup?
Thanks |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.