Build server prototype (integration with GitHub / NuGet / etc)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Inga 🏳‍🌈 58bb14c1fd changed README language to English 1 year ago
Binaries NuGet 4 support (with custom-built NuGet.exe v4) 8 years ago
BuildServer Fix 8 years ago
DotNetBuilder NuGet 4 support (with custom-built NuGet.exe v4) 8 years ago
.gitattributes DotNetBuilder implemented 11 years ago
.gitignore .gitignore updated 9 years ago
LICENSE Initial commit 11 years ago
MicroBuildServer.sln sln cleanup 8 years ago
README.md changed README language to English 1 year ago

README.md

micro-build-server

Motivation

TeamCity forces us to separately configure every branch on TeamCity server, which introduces an unreasonable friction for our short-lived feature dev branches, and would also force us to purchase the most expensive subscription because the cheaper ones come with a very limited number of branch configurations.

Since all our services are built more or less in a similar way, it is not very difficult to create our own build server, which is done in this repository.

Development

Install Node.js v6.

Run npm install in BuildServer directory.

Create app.ts based on app.ts.example.

To check code style or types, use npm test.

Setting up the server

Install Node.js v6.

Copy to the server build artifacts (contents of the bin\Release folder) of DotNetBuilder.

Add Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed (can be extracted out of 6.0.4 release on NuGet) and Microsoft.VisualStudio.Setup.Configuration.Interop, PublicKeyToken=b03f5f7f11d50a3a assemblies to GAC.

Clone the repo (git clone).

Run npm install in BuildServer directory.

Create app.ts based on app.ts.example (in order to use it in IIS set the value port: process.env["PORT"]). Values of gitpath, releasepath, tmpcodepath should be as short as possible.

Check that app.ts is correct by running npm test.

Build by npm build or npm run build.

Run by npm start or node app. In order to use in IIS, install iisnode, and create a new website in IIS, pointing to the BuildServer directory (the one with Web.config).

Depending on the system, you might also have to install Microsoft .NET Targeting Pack and appropriate version of Windows SDK to the server.

Updating the server

git pull origin master
npm test
npm run build

Usage

In the settings of a target repository (and all its forks), add a webhook pointing to https://micro-build-server/github/postreceive.

In target repository, create an mbs.pos file with contents of the following form:

{
	"type": "sequential",
	"params": {
		"tasks": [
			{
				"type": "dotnetbuild",
				"params": {
					"solution": "Legacy.Processing.Common.sln",
					"forceCodeAnalysis": "true"
				}
			},
			{
				"type": "dotnetnugetprocess",
				"params": {
					"masterRepoOwner": "Legacy",
					"nuspecName": "Legacy.Processing.Common",
					"major": "4"
				}
			}
		]
	}
}

All supported task types and their parameters are declared in BuildServer\lib\tasks.

In order to implement a new task type, create a new yourtaskname.ts in that directory.

This will automatically add build status comments to your PRs, and automatically close PRs when needed.

In order to display a badge with the build status for the relevant branch, add the following line to README.md of the target repository:

![Status](https://micro.build.server/status.svg)

Or alternatively, manually go to the page with the build report, by changing the URL in the address bar from https://github.enterprise/what/ever to https://micro.build.server/github.enterprise/what/ever.

In both cases, it will display the build status of the relevant branch or commit.