Skip to content

Instantly share code, notes, and snippets.

View andykuszyk's full-sized avatar

andykuszyk

  • Typeform
  • Southampton, UK
View GitHub Profile
@andykuszyk
andykuszyk / Creating and Publishing NuGet Packages.md
Last active July 8, 2021 14:51
Creating and Publishing NuGet Packages

Creating and Publishing NuGet Packages

Introduction

This document describes how to publish a nuget packages by creating a nuspec and then publishing it to a server.

How do we get from dll to publish nuget package?

In order to publish dlls as a nuget package, we need to perform these three steps:

  1. Create a nuspec;
  2. Pack the nuspec;
@andykuszyk
andykuszyk / replace-assembly-info-versions.ps1
Last active June 10, 2016 09:06
Replace version numbers in assembly info files
# This powershell script is aimed at batch replacing version numbers
# in assembly info files. Provide the old version number that needs replacing
# and the new version number to replace it with. Run the script
# in the solution directory (e.g. the one that contains [ProjectName]\properties folders)
Param([string]$oldVersion, [string]$newVersion)
foreach($folder in Get-ChildItem -dir) {
$assemblyInfoPath = "$folder\properties\AssemblyInfo.cs"
Write-Host "Assembly info path: $assemblyInfoPath"
if(Test-Path $assemblyInfoPath) {
@andykuszyk
andykuszyk / Increasing version numbers in project.json or AssemblyInfo.cs using Powershell.md
Last active June 1, 2016 11:37
Increasing version numbers in project.json or AssemblyInfo.cs using Powershell

#Increasing version numbers in project.json or AssemblyInfo.cs using Powershell

As part of an automated deployment process, I needed to increase the minor version numbers stored in both project.json and AssemblyInfo.cs files. I achieved this with broadly similar powershell scripts.

Project.json

## This script picks up a json file, locates the version property and
## increases the most minor version number by 1.
@andykuszyk
andykuszyk / Common Powershell commands.md
Last active October 13, 2016 09:20
Common Powershell commands

A collection of common Powershell commands that I frequently use.

Outputting to the console

Write to the console with:

Write-Host "My message"

Bypass the execution policy for the current user

To execute scripts in a powershell console, use:

@andykuszyk
andykuszyk / Installing multiple Bamboo remote agents on a single machine.md
Last active December 14, 2023 18:04
Installing multiple Bamboo remote agents on a single machine (as a Windows service)

Installing multiple Bamboo remote agents on a single machine (as a Windows service)

I've recently been setting up multiple remote agents for Bamboo on the same machine to run as Windows service instances. Although there's information out there as to how this is achieved, I thought I'd document all the steps here for future reference.

Pre-requisites

Assumptions are that you have:

  • Installed Bamboo on a server somewhere;
  • Have another machine that you want to install remote agents on;
  • This other machine can access the server over http;
  • The other machine has java installed on it;
@andykuszyk
andykuszyk / Running NUnit3 tests in Go CD.md
Created May 9, 2016 09:01
Running NUnit3 tests in Go CD

#Running NUnit3 tests in Go CD

Running NUnit3 tests under Go CD is easy enough using the console runner, but the outputted test results are not understood by Go, even when you mark them as a test artifact.

In order for them to be recoginized by Go, you need to output the test results xml file in the NUnit2 version.

This can be done by adding the following option to your command line call@

--result=TestResult.xml;format=nunit2

@andykuszyk
andykuszyk / Git command line cheat sheet.md
Last active May 6, 2016 08:47
Git command line cheat sheet

#Git command line cheat sheet

Workflow

In a typical workflow, you might perform the following steps in approximately this order:

  1. Fetch metadata about new branches from the remote repo;
  2. Checkout a remote branch locally;
  3. Stage changes;
  4. Commit changes (and repeat);
  5. Push your changes to the remote topic branch;
@andykuszyk
andykuszyk / Delete all data from a SQL Server database.md
Last active April 25, 2016 09:27
Delete all data from a SQL Server database

Delete all data from a SQL Server database

Why?

At the moment, I'm experimenting with interactions with a new database. I could very easily create the schema once and then take a backup of the database, restoring this backup every time I want to start again with a fresh copy.

However, it's a little more hassle free to leave the database in situ (especially because I want to use the same connection details each time) and just nuke all the data instead.

How?

Removing all the data from a database is almost as easy as running a DELETE FROM for every table, except that you need to suspend constraints temporarily whilst you're doing so:

@andykuszyk
andykuszyk / Integrating BitBucket with JIRA in the cloud.md
Last active March 7, 2016 11:27
Integrating BitBucket with JIRA in the cloud

Integrating BitBucket with JIRA in the cloud

Introduction

BitBucket and JIRA can be integrated such that JIRA issues display a development panel that allows you to create branches and pull requests and which can display commits that relate to that issue.

In order to setup this integration, a number of steps need to be followed that are widely documented, especially by Atlassian. I'm just noting down some of the perculiarities that helped me to get this setup.

Setting up POST services in BitBucket

In order for JIRA to remain up-to-date with BitBucket when things change in a repo, your repo needs to have two POST services configured. These are normally added automatically when you link a JIRA account with a BitBucket account, but if not:

@andykuszyk
andykuszyk / Useful Git Hooks.md
Last active April 19, 2017 20:52
Useful Git Hooks

#Useful Git Hooks

Below are a couple of simple git hooks that can be useful for controlling and formatting commits. These are generally re-hashes of other people's ideas, so I've credited these as appropriate.

Git Hooks

A git hook is a script that lives in your .git/hooks directory. The scripts are invoked when certain events occur within your repo, such as make a commit or pushing changes. Hooks can be used to automate and augment basic actions within your repos.

##Include an issue number in your commit message To amend your commit messages after they have been submitted, you'll need a commit-msg hook. I borrowed most of these ideas from @monkseal. This hook assumes that your issue numbers are formatted into you branch names in a way that you can extract using a regex.