Skip to content

Commit

Permalink
Script to deploy release to specific tenant
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethBates committed Nov 10, 2017
1 parent 63819af commit 4ccc3e2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Octopus.Client/PowerShell/Deployments/DeployReleaseToTenant.ps1
@@ -0,0 +1,22 @@
# You can get this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path 'Octopus.Client.dll'

$apikey = 'API-xxx' # Get this from your profile
$octopusURI = 'http://localhost' # Your Octopus Server address

$releaseId = "Releases-1" # Get this from /api/releases
$environmentId = "Environments-1" # Get this from /api/environments
$tenantId = "Tenants-1" # Get this from /api/tenants

$endpoint = New-Object Octopus.Client.OctopusServerEndpoint $octopusURI,$apikey
$repository = New-Object Octopus.Client.OctopusRepository $endpoint

$release = $repository.Releases.Get($releaseId);
$deployment = new-object Octopus.Client.Model.DeploymentResource
$deployment.ReleaseId = $release.Id
$deployment.ProjectId = $release.ProjectId
$deployment.EnvironmentId = $environmentId
$deployment.TenantId = $tenantId

$repository.Deployments.Create($deployment)

0 comments on commit 4ccc3e2

Please sign in to comment.