Hi,
I was wondering if it will be possible to list projects based on the machinerole of a specific machine with octo.exe in the future.
This could be very usable for deploying Applications to newly installed machines/instances via a script.
Right now I have to write down the projects that I want to deploy to the servers, so every time I add a new project for that role I have to add it to the script.
This is the script I currently use:
@@@
$OctopusServer=“http://octpus.com”
$APIKey=“API-********************”
$OctopusProject1=“Polling Test APP”
$Environment=“TEST”
write-host “Get latest release for project $octopusProject1 and environment $environment"
Set-Alias Octo “F:\Acceptance install\Octo.exe” -scope Script
$release = (Octo list-latestdeployments --project=”$OctopusProject1" --server="$OctopusServer" --apikey="$APIKey" --environment="$Environment" | ?{$_.contains(" Version:") } | select-object -first 1)
if (!$release) {
write-warning "Current release for $octopusProject not found"
return
}
write-host “Pull current release of $octopusProject1 $release”
$release = $release -replace “\s+Version:\s+”, ““
Octo deploy-release --project=”$OctopusProject1” --server="$OctopusServer" --apikey="$APIKey" --releaseNumber="$release" --deployto="$Environment" --specificmachines="$env:COMPUTERNAME" --waitfordeployment --deploymenttimeout=“01:00:00”~
@@@
It would be a lot easier and less maintenance if I can create a list of all the applications for that server on that environment.
Thanks!
Andy