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
$i = 0 | |
$step = $OctopusParameters["Octopus.Step[$i].Id"] | |
while ($step -ne $null) { | |
Write-Output $OctopusParameters["Octopus.Step[$i].Id"] | |
Write-Output $OctopusParameters["Octopus.Step[$i].Name"] | |
Write-Output $OctopusParameters["Octopus.Step[$i].TargetRoles"] | |
Write-Output $OctopusParameters["Octopus.Step[$i].Script.ScriptBody"] | |
$i++ | |
$step = $OctopusParameters["Octopus.Step[$i].Id"] |
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
# Raven Import Script | |
# You'll need a copy of Raven.Abstractions.dll, Raven.Client.Lightweight.dll, Jint.Raven.dll and Raven.Smuggler.exe | |
# in a lib folder (note: one more than the export script) under the location of this script. | |
# You can find them in the folder where Octopus Deploy is installed. | |
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$false,Position=1)] | |
[string]$importPath = ".\dump.raven", |
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
# Raven Export Script | |
# You'll need a copy of Raven.Abstractions.dll, Raven.Client.Lightweight.dll, | |
# Microsoft.CompilerServices.AsyncTargetingPack.Net4.dll, and Raven.Smuggler.exe in a lib folder | |
# under the location of this script. You can find them in the folder where Octopus Deploy is installed. | |
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$false,Position=1)] | |
[string]$exportPath = ".\dump.raven", |
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
$octoBase = "http://octopusserver:port" | |
$apiKey = "API-XXXXXXXXXX" | |
Function GetFromOctopus([string]$relUrl) { | |
return Invoke-RestMethod -Uri "$octoBase$relUrl\?apiKey=$apiKey" -Method Get | |
} | |
$projects = GetFromOctopus -relUrl "/api/projects/all" | |
ForEach ($p in $projects.Items) { | |
$processLink = $p.Links.DeploymentProcess |
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
var OctoTool = { | |
GetEnvironmentMap: function(machineStatus) { | |
var machinesByEnv = angular.element($('.octo-group-body.machines')).scope().environments.map(function(el, i) { | |
var em = angular.element($('.octo-group-body.machines')).scope().machines[el.Id]; | |
return {EnvironmentId: el.Id, OnlineMachines: em ? em[machineStatus] : null} ; | |
}) | |
var values = {}; | |
for (var i=0; i<machinesByEnv.length; i++) { | |
values[machinesByEnv[i].EnvironmentId] = machinesByEnv[i].OnlineMachines; | |
} |
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
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$true,Position=1)] | |
[string]$OctopusUrl = "http://localhost:80", | |
[Parameter(Mandatory=$true,Position=2)] | |
[string]$ApiKey, | |
[Parameter(Mandatory=$false,Position=3)] | |
[switch]$Delete |
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
Function Get-OctopusEnvironmentMachines{ | |
Param( | |
[string]$EnvironmentName, #"App1 DEV" | |
[string]$APIKey, #API-XXXXXXXXXXXXXXXXXXXXXXXXX | |
[string]$OctopusBaseURI #http://octopus | |
) | |
try{ | |
$environmentsJSON=Invoke-WebRequest -URI "$OctopusBaseURI/api/environments" -Header @{ "X-Octopus-ApiKey" = $apiKey } -Method GET; | |
}catch{ | |
throw "Get-OctopusEnvironmentMachines: Failed to retrieve list of environments :: $_ " |
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
{ | |
"Id": "ActionTemplates-41", | |
"Name": "Chain Deployment", | |
"Description": "Trigger a deployment for another project in Octopus", | |
"ActionType": "Octopus.Script", | |
"Version": 10, | |
"Properties": { | |
"Octopus.Action.Script.Syntax": "PowerShell", | |
"Octopus.Action.Script.ScriptSource": "Inline", | |
"Octopus.Action.Script.ScriptBody": "Write-Host \"**********\"\nWrite-Host \"Chained Deployment of '$Chain_ProjectName' version '$Chain_ReleaseNum' to '$Chain_DeployTo'.\"\nswitch ($Chain_CreateOption) {\n \"Try\" { Write-Host \" Release will be created if it doesn't exist.\" }\n \"Create\" { Write-Host \" Release will be created before deploying.\" }\n \"NoCreate\" { Write-Host \" Release will not be created and should already exist.\" }\n}\nWrite-Host \"**********\"\n\n$baseUri = $OctopusParameters['Octopus.Web.BaseUrl']\n$reqheaders = @{\"X-Octopus-ApiKey\" = $Chain_ApiKey }\n\n# Find Environment\n$environments = Invoke-WebRequest \"$baseUri/api/environments/all\" -Headers $reqheaders -UseBasic |
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
function Invoke-OctopusLogoUpload | |
{ | |
[CmdletBinding()] | |
PARAM | |
( | |
[string][parameter(Mandatory = $true)][ValidateNotNullOrEmpty()]$InFile, | |
[string]$ContentType, | |
[Uri][parameter(Mandatory = $true)][ValidateNotNullOrEmpty()]$Uri, | |
[string][parameter(Mandatory = $true)]$ApiKey | |
) |
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
namespace Microsoft.VisualStudio.TestTools.UnitTesting | |
{ | |
public static class Asserṭ | |
{ | |
public static void AreEqual(Object expected, Object actual, params object[] parameters) { } | |
public static void AreEqual<T>(T expected, T actual, params object[] parameters) { } | |
public static void AreNotEqual(Object expected, Object actual, params object[] parameters) { } |
OlderNewer