Skip to content

Instantly share code, notes, and snippets.

View HowardvanRooijen's full-sized avatar

Howard van Rooijen HowardvanRooijen

View GitHub Profile
@HowardvanRooijen
HowardvanRooijen / gist:6130133
Created August 1, 2013 10:13
Execute-TeamCityBackup.ps1 Fragment
$server = "http://YOUR_SERVER"
$addTimestamp = $true
$includeConfigs = $true
$includeDatabase = $true
$includeBuildLogs = $true
$includePersonalChanges = $true
$fileName = "TeamCity_Backup_"
$username = "USERNAME" # Must be a TeamCity Admin
$password = "PASSWORD"
@HowardvanRooijen
HowardvanRooijen / Execute-BackupArchive.ps1
Last active December 20, 2015 12:19
Execute-BackupArchive.ps1 for backing up and archiving TeamCity backups
function Execute-BackupArchive
{
param
(
[string] $sourcePath,
[string] $destinationPath,
[int] $minimumAge
)
$archiveFilesPath = ($sourcePath + "\to_delete")
function Execute-HTTPPostCommand() {
param(
[string] $url,
[string] $username,
[string] $password
)
$authInfo = $username + ":" + $password
$authInfo = [System.Convert]::ToBase64String([System.Text.Encoding]::Default.GetBytes($authInfo))
@HowardvanRooijen
HowardvanRooijen / gist:9efebfcf8be7825153b7
Created May 28, 2014 08:32
Create a HTML file containing a list of all the Azure Virtual Machine Images
Get-AzureVMImage | ConvertTo-HTML | Out-File C:\temp\AzureVmImages.htm
@HowardvanRooijen
HowardvanRooijen / teamcity-plugin.xml
Created June 16, 2014 07:38
Top Level TeamCity MetaRunner Plugin definition
<?xml version="1.0" encoding="UTF-8"?>
<teamcity-plugin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:shemas-jetbrains-com:teamcity-plugin-v1-xml">
<info>
<name>NewRelicDeploymentNotifierPlugin</name>
<display-name>NewRelic Deployment Notifier</display-name>
<version>snapshot</version>
<description>Notifies NewRelic that a new deployment has occurred.</description>
<vendor>
<name>Endjin Limited</name>
@HowardvanRooijen
HowardvanRooijen / teamcity-plugin.xml
Created June 16, 2014 07:40
TeamCity MetaRunner Plugin descriptor - defined that the plugin contain tools - located in agent\teamcity-plugin.xml
<?xml version="1.0" encoding="UTF-8"?>
<teamcity-agent-plugin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:shemas-jetbrains-com:teamcity-agent-plugin-v1-xml">
<tool-deployment/>
</teamcity-agent-plugin>
@HowardvanRooijen
HowardvanRooijen / MRPLUGIN_NewRelicDeploymentNotifier.xml
Created June 16, 2014 07:48
TeamCity MetaRunner descriptor file
<?xml version="1.0" encoding="UTF-8"?>
<meta-runner name="NewRelic Deployment Notifier">
<description>Notify NewRelic that a new deployment has occurred</description>
<settings>
<parameters>
<!-- Mandatory Fields -->
<param name="teamcity.tool.newrelic.deploymentnotifier.apikey" value="" spec="text description='NewRelic API Key' display='normal' label='API Key' validationMode='not_empty'" />
<param name="teamcity.tool.newrelic.deploymentnotifier.appname" value="" spec="text description='The value of app_name in the newrelic configuration file used by the application. This may be different than the label that appears in the RPM UI. You can find the app_name value in RPM by looking at the label settings for your application.' display='normal' label='App Name' validationMode='not_empty'" />
<!-- Optional Fields -->
<param name="teamcity.tool.newrelic.deploymentnotifier.changelog" value="" spec="text description='A list of changes for this deployment' display='normal' label='
@HowardvanRooijen
HowardvanRooijen / NotifyNewRelicCommand.txt
Created June 16, 2014 08:02
Notify NewRelic Curl Command
&quot;%teamcity.agent.tools.dir%\nr-deployment-notifier\bin\curl.exe&quot; -silent -k
-H &quot;x-api-key:%teamcity.tool.newrelic.deploymentnotifier.apikey%&quot;
-d &quot;deployment[app_name]=%teamcity.tool.newrelic.deploymentnotifier.appname%&quot;
-d &quot;deployment[changelog]=%teamcity.tool.newrelic.deploymentnotifier.changelog%&quot;
-d &quot;deployment[description]=%teamcity.tool.newrelic.deploymentnotifier.description%&quot;
-d &quot;deployment[environment]=%teamcity.tool.newrelic.deploymentnotifier.environment%&quot;
-d &quot;deployment[revision]=%teamcity.tool.newrelic.deploymentnotifier.revision%&quot;
-d &quot;deployment[user]=%teamcity.tool.newrelic.deploymentnotifier.user%&quot;
https://api.newrelic.com/deployments.xml
try
{
$body = "";
if ([String]::IsNullOrEmpty($apiKey)){
throw "API Key is required"
} else {
$headers += @{"x-api-key"=($apiKey)};
}
@HowardvanRooijen
HowardvanRooijen / NuGet.config
Last active August 29, 2015 14:03
Default Nuget.config files configured for automatic package restore. Valid for NuGet 2.8
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="repositorypath" value=".\..\Packages\" />
<!-- Lowest/HighestPatch/HighestMinor/Highest -->
<add key="dependencyversion" value="Highest" />
</config>
<packageRestore>
<!-- Allow NuGet to download missing packages -->
<add key="enabled" value="True" />