Is there any way to freeze the build in Cruise Control .NET? - ccnet-config

I am using Cruise Control .NET to automate the build. I have configured lots of project for the automated build in CCNET. Is there any way to freeze particular build and after sometime, i wanna release that to old state, like i wanna remove the freeze and the user would be able to build it again.
Can i do some configuration for the same?

You have to edit the config file. The easiest way is to set the <triggers/> to empty. That way you can still manually force a build but the automation will stop.
<cruisecontrol>
<project name="MyProject">
<webURL>http://mybuildserver/ccnet/</webURL>
<triggers>
<!-- No more automated builds -->
<!-- <intervalTrigger seconds="60" /> -->
</triggers>
<modificationDelaySeconds>10</modificationDelaySeconds>
Update
This is mainly when i give a build to
QA for testing, and others should not
force buil by mistake and change the
build. For this reason i am looking
something which can freeze the build.
You shouldn't rely on having to pause the build system. The whole point of CruiseControl is to implement a continuous build system. You are breaking that model by trying to stop the builds. You should setup a pipeline for your builds:
Tag Build with Date and Release information. Release Candidate 0.1 Build 23423_20110602
Deploy a build to another machine for testing.
This way you know exactly which build the QA team is testing. And more importantly, you can go back in time in your version control system to see the code or branch.
There isn't any point having CruiseControl if the policy is to pause the build for each QA cycle. I suggest rethinking the process and coming up with a solution that doesn't involve having to stop the builds.

Related

Code to Test In Blazor WASM (make it NOT slow)

How can I faster test changes in Layout using Blazor?
I used to code websites in good old Apache+PHP+MySQL. and now I am starting with some development in Blazor.
But I find it difficult to work on the user interface. When I need to test a small change, for instance moving a entry in a web form from one row to another...
Blazor WASM development process:
Edit the code
Shutdown the browser
Recompile (Pray that it compiles...)
Wait for the webapp+API-App+Identity App to startup
Navigate to the page I am making layout on.
PHP+X Process
Edit the code
Press F5
I wish for a similar experience.
How can I decrease the development code/test UI time when using Blazor?
The simplest way to do interactive development is using dotnet watch run from a command prompt (I add a .cmd script to my projects to run this for the project). This will run the project and watch for changes to files, then re-compile the project.
On .NET 3.x Blazor you'll have to refresh the browser (F5). On .NET 5 projects it does this automatically.
You may also want to read Rémi Bourgarel's Blog article on this, although I am not sure all his points are still valid if you're using .NET 5.

Better alternative to Web Deploy Projects

I have a solution with a fair few projects, 3 of them web-based (WCF in IIS / MVC site). When the solution builds, it dumps each of the components of this distributed system in a 'Build' folder. Running the 'configurator' part of the whole output will set up the system in the cloud automatically. It's very neat :) However, the Web Deploy Projects are a major pain. They "build" (i.e. deploy) every, single, time I build - even when no changes have been made to their respective projects.
Changed a single line of code? Look forward to waiting around a minute for the 3 web projects to redeploy.
[These projects are VERY straightforward at the moment - two have a single .svc and one .ashx file - the other is an MVC app with ~5 views]
I realise I can change solution configurations to not 'build' them, but I've been doing that and it's very easy to log on the next day and forget about it, and spend a couple of hours tracking down bugs in distributed systems due to something simply having not been built.
Why I use Web Deploy Projects? Well, because I need all pages + binaries from the web project. The build output for the project itself is the 'bin' folder, so no pages. The entire project folder? It has .cs, .csproj and other files I don't want included.
This will be building on build servers eventually, but it's local at the moment. But I want a quick way of getting the actual output files from the web project to my target folder. Any ideas?
Not sure if this will help in your situation, (plug for own project coming up), but I am working on a project to help ease IIS deployments:
https://github.com/twistedtwig/AutomatedDeployments
The idea being you can use config files for IIS (app Pool, applications and websites) to automate the creation and update of sites locally (dev machines) or remotely (test and production machines).
It is still a work in progress but is ready to be used in production systems.
using the package creation as a post build step might get you closer to what you want, (don't believe it includes all the extra files), but that would still build it each time, (although if code hasn't changed it should not rebuild unless you choose rebuild all projects).
In the end I created a utility/tool which, given a project file, XCOPYies the project folder for the web project to a target location, then looks in said project file and deletes anything that doesn't have Build Action set to Content. Very quick and effective.
I know it is still in RC but VS2012 does have a neat feature when doing publish that it detects the changes and publishes only those. Might be something a little deeper down in the build where it does an automatic publish too.
You can take a look to the Octopus project: http://octopusdeploy.com/
Deployment based on nuget packages.

Switch to turn off Asp.Net website compilation in cruise control build

Is there a switch to pass to the devenv task in Cruise Control to turn off / on website compilation.
I want certain builds to build the site (very time consuming with batch='false') + run Simian etc, while more frequent builds only build the libraries
AFAIK this is generally controlled by the 'Build Website as part of Solution' option, is there a way to change this through CC.NEt config?
You can fine-tune which projects get built with Soluion Configurations:
and then tell CriuseControl which solution configuration to build.

Flex, Ant and TeamCity

Is anyone using TeamCity for building their Flex apps? We're using .Net for our main site code and backend flex data calls and we use flex for our application. I have a working Ant build script, but I can't get it to run with the TeamCity Ant Runner. I'm curious if anyone has gotten this working and if they have, could I potentitially see a sample of your build script?
For some reason the build script won't pick up the FLEX_HOME environment variables for the Flex Ant Tasks.
I cannot see why it shouldn´t work. Just declare FLEX_HOME in the top of your Ant script, and point to the sdk on the TeamCity machine, like:
<property name="FLEX_HOME" value="c:/adobe/flex/sdk/3.3"/>
On a previous project I worked on we had exactly the same situation as you and it can work. I can't remember doing anything special to get this going although we may have had to manually set some environment variables in the TeamCity config. Check out the TeamCity docs for how to set these and how to they are used
You might also try using the basic Command line runner to see if that works. When troubleshooting environment variable issues in TeamCity I have found it useful to have part of the build process run a DOS set command (env for Linux) and then look in the build logs to see what the actual environment is.

Best way to manage generated code in an automated build?

In my automated NAnt build we have a step that generates a lot of code off of the database (using SubSonic) and the code is separated into folders that match the schema name in the database. For example:
/generated-code
/dbo
SomeTable.cs
OtherTable.cs
/abc
Customer.cs
Order.cs
The schema names are there to isolate the generated classes that an app will need. For example, there is an ABC app, that will pull in the generated code from this central folder. I'm doing that on a pre-build event, like this:
del /F /Q $(ProjectDir)Entities\generated*.cs
copy $(ProjectDir)....\generated-code\abc*.cs $(ProjectDir)Entities\generated*.cs
So on every build, the Nant script runs the generator which puts all the code into a central holding place, then it kicks off the solution build... which includes pre-build events for each of the projects that need their generated classes.
So here's the friction I'm seeing:
1) Each new app needs to setup this pre-build event. It kind of sucks to have to do this.
2) In our build server we don't generate code, so I actually have an IF $(ConfigurationName) == "Debug" before each of those commands, so it doens't happen for release builds
3) Sometimes the commands fail, which fails our local build. It will fail if:
- there is no generated code yet (just setting up a new project, no database yet)
- there is no existing code in the directory (first build)
usually these are minor fixes and we've just hacked our way to getting a new project or a new machine up and running with the build, but it's preventing me from my 1-click-build Nirvana.
So I'd like to hear suggestions on how to improve this where it's a bit more durable. Maybe move the copying of the code into the application folders into the NAnt script? This seems kind of backwards to me, but I'm willing to listen to arguments for it.
OK, fire away :)
How often does your DB schema change? Wouldn't it be possible to generate the database-related files on demand (e.g. when the schema changes) and then check them into your code repository?
If your database schema doesn't change, you can also package the compiled *.cs classes and distribute the archive to other projects.
We have two projects in our solution that are built completely out of generated code. Basically, we run the code generator .exe as a post-build step for another project and along with generating the code, it automates the active instance of visual studio to make sure that the generated project is in the solution, that it has all of the generated code files, and that they are checked out/added to TFS as necessary.
It very rarely flakes out during the VS automation stage, and we have to run it "by hand" but that's usually only if you have several instances of VS open with >1 instance of the solution open and it can't figure out which one it's supposed to automate.
Our solution and process are such that the generation should always be done and correct before our auto-build gets to it, so this approach might not work for you.
Yeah I'd like to take VS out of the equation so that a build from VS is just simply compiling the code and references.
I can manage the NAnt script... I'm just wondering if people have advice around having 1 NAnt script, or possibly one for each project which can push the code into the projects rather than being pulled.
This does mean that you have to opt-in to generate code.

Resources