Created
April 10, 2015 13:45
-
-
Save Dalmirog-zz/1243ec316473c564471d to your computer and use it in GitHub Desktop.
Get next Octopus 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
$apiKey = "Your API Key" | |
$OctopusURL = "Your Octopus URL" | |
$Header = @{ "X-Octopus-ApiKey" = $apiKey } | |
$ProjectName = "Your Project Name" | |
#Getting Environment and Project By Name | |
$Project = Invoke-WebRequest -Uri "$OctopusURL/api/projects/$ProjectName" -Headers $Header| ConvertFrom-Json | |
#Getting Deployment Template to get Next version | |
$dt = Invoke-WebRequest -Uri "$OctopusURL/api/deploymentprocesses/deploymentprocess-$($project.Id)/template" -Headers $Header | ConvertFrom-Json | |
#$dt.NextVersionIncrement contains the next version | |
#that Octopus would normally auto-generate based on your | |
#project versioning strategy set on Projects -> [Project Name] -> Settings | |
$dt.NextVersionIncrement |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment