This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script that will: | |
# 1. Create a workspace. Workspacce Name: <ComputerName>_Root | |
# 2. Get the latest code from repository | |
# TODO: This needs to handle making workspace PER PROJECT, which it doesn't yet. | |
# TODO: It should create a local directory for each project in TFS, along with the workspace to download the files. | |
[string] $tfsDomain = "foo" | |
[string] $tfsServer = "https://" + $tfsDomain + ".visualstudio.com/defaultcollection" | |
[string] $userName = [system.environment]::UserName; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'chargify_api_ares' | |
require 'csv' | |
Chargify.configure do |c| | |
c.subdomain = '' | |
c.api_key = '' | |
end | |
CSV.open('subscription_coupons.csv', 'wb') do |csv| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd .. # Since PostDeploy is in the latest deployed version directory, just back out one level. Thanks Paul! | |
$path = Get-Location | |
$folders = Get-ChildItem -Path $path -Recurse | Where-Object {$_.PsIsContainer} | |
$keep = 3 | |
if ($folders.Count -gt $keep) { | |
$folders |Sort-Object CreationTime |Select-Object -First ($folders.Count - $keep)| Remove-Item -Force | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($OctopusEnvironmentName -eq "Production") { | |
# in production, we need to | |
#Create a URI instance since the HttpWebRequest.Create Method will escape the URL by default. | |
$URL = "http://api.newrelic.com/deployments.xml" | |
$post = "deployment[account_id]=<id here>&deployment[user]=OctopusDeploy&deployment[app_id]=<app id here>&deployment[revision]=($OctopusPackageVersion)" | |
$URI = New-Object System.Uri($URL,$true) | |
#Create a request object using the URI | |
$request = [System.Net.HttpWebRequest]::Create($URI) | |
NewerOlder