Posts

Showing posts from February, 2012

Team City and Powershell

Image
Spanish version / Versión en Español Say we need Team City to perform certain actions but we don't want to add another script to source control. In my case, I needed Team City to create a file if it didn't exist, and delete some others if they did. I couldn't use MSBuild for this because I needed this to be done before building any project. Though there are workarounds for that, they implied adding MSBuild scripts to source control. To avoid further cluttering the repo, Powershell is a good choice here. Using Team City's jargon, we can add a Build Step with a Powershell Build Runner , and write the script directly in its configuration page. Said script will be stored by Team City, leaving our repo intact. First of all, we need to have Powershell installed in our build server machine. It's usually bundled with Visual Studio and SQL Server installs, so most likely you already have it. Nevertheless, you can check if it so by opening a terminal and typing

Team City y Powershell

Image
Versión en inglés / English version Supongamos que necesitamos que Team City realice cierta acción sin tener que poner un script en control de código. En mi caso, necesitaba que Team City creara un archivo si no existía, y borrara otros si existían. No podía resolver esto con MSBuild porque necesitaba que se hiciera antes de compilar cualquier proyecto. Para no llenar aún más el repositorio, Powershell es una buena opción. Usando la jerga de Team City, podemos agregar un Build Step con un Build Runner de tipo Powershell, y escribir el contenido del script directamente en su configuración. Dicho script será almacenado por Team City, sin tocar nuestro repo. Si vamos a implementar esto, para empezar necesitamos que Powershell esté instalado en el servidor de integración continua. Típicamente, viene con Visual Studio y SQL Server, así que es casi seguro que ya está. De todas formas, para verificarlo, se puede abrir una consola, escribir powershell y darle a Enter. Si Powersh