Category Archives: continuous integration

Custom role for deployment to Azure Web App slots

Azure Web App supports deployment slots. Production slot is the main one and there can be a couple of others. In order to follow a principle of least privileges different slots should have different security principals for deployment.

A service principal with deployment permissions for only a dedicated slot is useful in order to limit access to production deployment.

Continue reading

How to build and deploy a web deployment package using MSBuild

Web application packaging and deployment automation using MSBuild needs the following steps:

deployicon

Step 0. Server preparation is covered here How to prepare a Windows Server 2012 for web deployment

  1. Configure solution build profiles
  2. Configure transformation of web.config file
  3. Configure publishing profiles
  4. Create a web deployment package with MSBuild script
  5. Run deployment from command line

Sample solution that includes build script and configured publishing profiles can be downloaded here https://github.com/mchudinov/BuildWebDeployPackage
Continue reading

How to prepare a Windows Server 2012 for web deployment

Here is a list of steps for preparation of a Windows Server 2012 for deployment of web packages or deployment from Visual Studio.

windows-server

  1. Activate Web server role
  2. Install Web Deploy
  3. Open network ports
  4. Create an account for deployment
  5. Create web sites
  6. Configure deployment for sites

Continue reading

Packaging of a .NET application on Windows

This post is about how to package .NET application for Windows into an MSI (MicroSoft Installer) package using Wix# tool in command line. Packaging process can be easily automated on continues integration server.

msi_package

Generally application building workflow is simple:

  • Assign a version number to an assembly
  • Build binaries
  • Copy binaries to package folder and build msi-package with the same version as  assembly

Build process will be controlled by MSBuild project file and can be started from a continues integrations server.

Sample solution is available for download here https://github.com/mchudinov/PackagingMSI. Solution is compatible with Visual Studio 2013.

Automated building and versioning processes were described in my previous posts:

Continue reading

Packaging of a Mono application on Linux

How to package a Mono (.NET) applications for Debian-based Linux in command line. Packaging process can be easily automated on Continues Integration Server.

debian_package

Package building workflow is quite simple:

  • Assign a version number to a .NET assembly code
  • Build binaries
  • Copy binaries to package folder and build deb-package with the same version as an assembly

Build process will be controlled by MSBuild project file and run from a continues integrations server. MSBuild on Mono platform is substituted by xbuild utility.

Sample solution is available for download here https://github.com/mchudinov/PackagingMono. Solution is compatible with Visual Studio 2012, MonoDevelop/Xamarin Studio 5.

This is my third blogpost about automation of development workflow with Mono. Automated building and versioning were covered in my previous posts:

Continue reading

Versioning of .NET assemblies

I use four-parts version pattern that looks like: {Major}.{Minor}.{Date (MMdd)}.{Build Number}

An example version in this format would look like: 1.7.1028.37, which breaks down into being the first major release, seventh minor release, built on 28 October, and has been the 37th build for v1.7. Every time assembly is rebuild build counter increases.

version1

Sample solution is available for download here https://github.com/mchudinov/Versioning.

Continue reading

Building and testing .NET application in command line

Setup: Windows – .NET 4.5, Linux – Mono 3, Mint 17 (based on Ubuntu 14). I need to build and test .NET application from command line and on CI server.
Sample solution can be downloaded from here https://github.com/mchudinov/BuildingTesting. Solution is compatible with MonoDevelop 5, Xamarin Studio 5 and Visual Studio 2012,2013,2015.

building_bricks

1. Building in command line

There are two standard command line building tools for .NET: MSBuild on Windows and xbuild on Linux/Mono. xbuild build files are compatible (with some exceptions) with MSBuild files.

We need at least 4 simple steps (targets as they called in MSBuild terminology) to build a .NET solution:

  • Clean
  • Restore NuGet packages
  • Build binaries
  • Run unit tests

Continue reading

TeamCity agent on Windows with Git through SSH

How to make work TeamCity Agent  on Windows with Git through SSH

1. Run TeamCity Agent not from System account

2. This account must have a PuTTY session stored with SSH key

3. Server’s key must be cached by the TeamCity agent acount. Run plink in console and point plink to the target server.

plink -agent -i c:\[path-to-key]\my_teamcity_private_key.ppk bitbucket.org

Confirm key caching ‘y’

How to change location of the pear.ini for php 5.4 and 5.5 on Windows

When PEAR installs itself on Windows it places pear.ini file in the system folder c:\Windows by default. Which sometimes needs to be changed after all. And sometimes it is not possible for some reasons (not sure why, probably a bug in PEAR installation scripts) to change this location during the installation. Then we need to change this location when PEAR is already installed and in use.
Continue reading