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 \Program Files\Octopus Deploy\Octopus | |
octopus.server service --stop | |
octopus.server reset-activities | |
octopus.server service --start |
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
Add-Type -Path "C:\Program Files\Octopus Deploy\Octopus\Octopus.Client.dll" | |
$baseUri = "http://localhost/octopus" | |
$apiKey = "API-xxxxxxxxxxxxxxxxxxxxxxxxx" | |
$endpoint = New-Object Octopus.Client.OctopusServerEndpoint $baseUri, $apiKey | |
$repository = New-Object Octopus.Client.OctopusRepository $endpoint | |
$project = $repository.Projects.FindByName("MyProject") | |
$deploymentProcess = $repository.DeploymentProcesses.Get($project.DeploymentProcessId) |
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
$OctopusAPIKey = "YourApiKey" | |
$OctopusURL = "YourOctopusURL" | |
$header = @{ "X-Octopus-ApiKey" = $OctopusAPIKey } | |
$steptemplateJson = Get-Content .\StepTemplate.txt #This file should contain the full Json of the step template | |
Invoke-RestMethod $OctopusURL/api/actiontemplates -Method Post -Headers $header -Body $steptemplateJson |
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 endpoint = new OctopusServerEndpoint(server, apiKey); | |
var repository = new OctopusRepository(endpoint); | |
var deployment = repository.Deployments.Get("deployments-1126"); | |
var task = repository.Tasks.Get(deployment.Links["Task"]); | |
var details = repository.Tasks.GetDetails(task); |
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
$webSiteName = $OctopusParameters['Octopus.Action[Deploy Workware Legacy].IISWebSite.WebSiteName'] | |
$appPoolName = $OctopusParameters['Octopus.Action[Deploy Workware Legacy].IISWebSite.WebSiteName'] | |
Write-Output "Web Site: $webSiteName" | |
Write-Output "App Pool: $appPoolName" | |
Import-Module WebAdministration -Force | |
$webSite = Get-Website -Name $webSiteName |
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
$baseUri = "http://urltooctopus" #Update this | |
$apiKey = "API-xxxxxxxxxxxxxxxxxxxxxxxxxxx" #Update this | |
$headers = @{"X-Octopus-ApiKey" = $apiKey} | |
$libraryVariableSetId = "LibraryVariableSets-1" #Update this | |
$projectName = "test" #Update this | |
function Get-OctopusResource([string]$uri) { | |
Write-Host "[GET]: $uri" | |
return Invoke-RestMethod -Method Get -Uri "$baseUri/$uri" -Headers $headers | |
} |
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
$baseUri = "" #Update this | |
$apiKey = "" #Update this | |
$headers = @{"X-Octopus-ApiKey" = $apiKey} | |
$DeploymentID = "" #Update this. ie deployments-835 | |
function Get-OctopusResource([string]$uri) { | |
Write-Host "[GET]: $uri" | |
return Invoke-RestMethod -Method Get -Uri "$baseUri/$uri" -Headers $headers | |
} |
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
#Easiest way to get these dlls is to find them | |
#on the tentacle/Octopus install dir like i'm doing here | |
Add-Type -Path "C:\Program Files\Octopus Deploy\Tentacle\Newtonsoft.Json.dll" | |
Add-Type -Path "C:\Program Files\Octopus Deploy\Tentacle\Octopus.Client.dll" | |
Add-Type -Path "C:\Program Files\Octopus Deploy\Tentacle\Octopus.Platform.dll" | |
$OctopusURL = "" #eg "http://BestDeploymentTool.mycompany.com" | |
$APIKey = "" #eg "API-YHMOPNVMRLFXJBV4EQRDIDNDJ" | |
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
##Config | |
$APIKey = "Your API Key" | |
$OctopusURL = "Your Octopus URL" | |
$EnvironmentName = "Your Environment Name" | |
$header = @{ "X-Octopus-ApiKey" = $APIKey } | |
## | |
$Environment = (Invoke-RestMethod "$OctopusURL/api/Environments/all" -Method Get -Headers $header) | ?{$_.name -eq $EnvironmentName} | |
$body = @{Arguments = @{EnvironmentID = $Environment.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
var endpoint = new Octopus.Client.OctopusServerEndpoint(baseUri, apiKey); | |
var repository = new Octopus.Client.OctopusRepository(endpoint); | |
var project = repository.Projects.FindByName(projectName); | |
var release = repository.Projects.GetReleaseByVersion(project, releaseVersion); | |
var artifact = new Octopus.Client.Model.ArtifactResource | |
{ | |
Filename = fileName, | |
RelatedDocumentIds = new Octopus.Platform.Model.ReferenceCollection(new [] { project.Id, release.Id }) | |
}; |