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 = "" #Your Octopus API Key | |
| $OctopusURL = "" #Your Octopus URL | |
| $header = @{ "X-Octopus-ApiKey" = $OctopusAPIKey } | |
| $body = @' | |
| { | |
| "Uri":"https://localhost:10935", | |
| "EnvironmentIds":["Environments-1"], | |
| "Thumbprint":"D0E492C262425473FF69531074CDD77987DBB862", | |
| "CommunicationStyle":"TentaclePassive", |
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-OctopusEvents ([datetime]$From,[datetime]$To,[string]$OctopusAPIKey,[string]$OctopusURL){ | |
| $fromStr = ($from).ToString("yyyy-MM-ddTHH:mm:ss") | |
| $toStr = ($to).ToString("yyyy-MM-ddTHH:mm:ss") | |
| $header = @{ "X-Octopus-ApiKey" = $OctopusAPIKey } | |
| $events = @() | |
| $skip = 0 | |
| do{ |
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": "variableset-projects-801", | |
| "OwnerId": "projects-801", | |
| "Version": 9, | |
| "Variables": [ | |
| { | |
| "Id": "a40ba9eb-0cd5-46df-ba3a-25a77e69a579", | |
| "Name": "Variable1", | |
| "Value": "Value1", | |
| "Scope": { |
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
| $apiKey = "" #Octopus API Key | |
| $OctopusURL = "" #Octopus URL | |
| $ProjectName = "" #project name | |
| $Header = @{ "X-Octopus-ApiKey" = $apiKey } | |
| #Getting Project By Name | |
| $Project = Invoke-WebRequest -Uri "$OctopusURL/api/projects/$ProjectName" -Headers $Header| ConvertFrom-Json | |
| #Getting Deployment Template to get next release version |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using Octopus.Client; | |
| using Octopus.Platform; | |
| namespace OctopusConsole | |
| { | |
| class Program |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using Octopus.Client; | |
| using Octopus.Platform; | |
| namespace OctopusConsole | |
| { | |
| class Program |
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
| $apiKey = "" #Octopus API Key | |
| $OctopusURL = "" #Octopus URL | |
| $Header = @{ "X-Octopus-ApiKey" = $apiKey } | |
| $ProjectName = "" #project name | |
| $releaseNumber = "" #Release number | |
| #Getting the project |
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
| #Connection variables | |
| $Libraryname = "YOURVARIABLESETNAME" | |
| $OctopusURI = "YOURURL" | |
| $apikey = "YOURAPI" | |
| #Creating a connection | |
| $endpoint = new-object -TypeName Octopus.Client.OctopusClient(New-Object Octopus.Client.OctopusServerEndpoint($OctopusURI,$apikey)) | |
| $repository = new-object Octopus.Client.OctopusRepository $endpoint | |
| #Getting the LibraryVariableSet by name |
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
| & C:\tools\octo.exe create-release --server=[MyServerURL] --ApiKey=[MyAPIKey] --Project=[MyProjectName] --deployto=[MyEnvironmentNAme] --variable=Message1:"This is message 1" --variable=Message2:"This is message 2" --progress |
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
| $versionNumber = '' | |
| $commitId = "" #branch | |
| $gitHubUsername = '' | |
| $gitHubRepository = '' | |
| $gitHubApiKey = '' | |
| $draft = $FALSE | |
| $preRelease = $TRUE | |
| $releaseData = @{ | |
| tag_name = [string]::Format("v{0}", $versionNumber); |