- Replace
<YourOctopusUrl>
with the URL of your Octopus server. - If you configured your Octopus server to not run at the root of the URL, replace
<YourOctopusVDirIfAnyOtherwiseJustBlank>
with the virtual directory you configured, otherwise remove it. - Replace
<YourOctopusApiKey>
with your API Key, see How to create an API Key for instructions. - Replace
<TheStepTemplateToFindAndUpdate>
with the name of the step template you want to update. - Run the script!
- After the script has completed (successfully :fingerscrossed:), go to
Library -> Step Templates ->
` -> Usage and update all the projects that use the step template.
This file contains 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 octopusUrl = "http://octopus.url"; | |
var apiKey = "API-xxxxxxxxxxxxxxxxxxxxxxxxxx"; | |
var octopusServer = new Octopus.Client.OctopusServerEndpoint(octopusUrl, apiKey); | |
var repo = new Octopus.Client.OctopusRepository(octopusServer); | |
var newLibraryVariableSet = new Octopus.Client.Model.LibraryVariableSetResource(); | |
newLibraryVariableSet.Name = "Skip Delta Compression"; | |
newLibraryVariableSet.Description = "Provides a shared variable set to skip delta compression that can be included on projects that shouldn't use it."; | |
var skipDeltaCompressionVariableSet = repo.LibraryVariableSets.Create(newLibraryVariableSet); |
This file contains 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
$deploymentJournalPath = Get-Item $env:TentacleJournal | |
if($deploymentJournalPath) { | |
$itemsToKeep = $null | |
$useItemsToKeep = [System.Int32]::TryParse($OctopusParameters["OctopusRetentionPolicyItemsToKeep"], [ref]$itemsToKeep) | |
if(-not $useItemsToKeep) { | |
Write-Host "Could not find the number of deployments to keep, ensure the lifecycle is set to keep a limited number of releases" | |
return | |
} | |
$projectId = $OctopusParameters["Octopus.Project.Id"] |
This file contains 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
$headers = @{"X-Octopus-ApiKey"="API-xxxxxxxxxxxxxxxxxxxxxxxxx"} | |
$environments = Invoke-RestMethod "http://url.to.octopus/api/environments/all" -Headers $headers -Method Get | |
$theEnvironment = $environments | ? { $_.Name -eq "TheEnvironmentName" } | |
$accounts = Invoke-RestMethod "http://url.to.octopus/api/accounts/all" -Headers $headers -Method Get | |
$theAccount = $accounts | ? { $_.Name -eq "TheAccount" } | |
$discovered = Invoke-RestMethod "http://url.to.octopus/api/machines/discover?host=hostnameoripaddress&type=Ssh" -Headers $headers -Method Get |
This file contains 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
# Step 1 - Run this on the Tentacle server to create the new Tentacle | |
$tentacleName = 'P1' | |
$tentaclePort = 10933 | |
& "C:\Program Files\Octopus Deploy\Tentacle\Tentacle.exe" create-instance --instance $tentacleName --config "C:\Octopus\$tentacleName\Tentacle-$tentacleName.config" | |
& "C:\Program Files\Octopus Deploy\Tentacle\Tentacle.exe" new-certificate --instance $tentacleName --if-blank | |
& "C:\Program Files\Octopus Deploy\Tentacle\Tentacle.exe" configure --instance $tentacleName --reset-trust | |
& "C:\Program Files\Octopus Deploy\Tentacle\Tentacle.exe" configure --instance $tentacleName --home "C:\Octopus\$tentacleName" --app "C:\Octopus\Applications\$tentacleName" --port $tentaclePort --noListen "True" | |
& "C:\Program Files\Octopus Deploy\Tentacle\Tentacle.exe" service --instance $tentacleName --install --start |
I hereby claim:
- I am hnrkndrssn on github.
- I am henrikandersson (https://keybase.io/henrikandersson) on keybase.
- I have a public key whose fingerprint is D41A B58C 846E 8C96 187D 3C78 3B2D 53D3 A3ED B9A5
To claim this, I am signing this object:
This file contains 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
<Query Kind="Program"> | |
<NuGetReference>Octokit</NuGetReference> | |
<Namespace>Octokit</Namespace> | |
<Namespace>System.Threading.Tasks</Namespace> | |
</Query> | |
static string product = "Octokit-LINQPad-2FA-Demo"; | |
IGitHubClient _Client = new GitHubClient(new ProductHeaderValue(product)); | |
string clientId = "client-id-of-your-registered-github-application"; | |
string clientSecret = "client-secret-of-your-registered-github-application"; |