Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Added documentation around PowerShell script
Browse files Browse the repository at this point in the history
  • Loading branch information
Damovisa committed May 22, 2015
1 parent 117fae4 commit d861f76
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 4 deletions.
Binary file added img/ps-addpowershellstep.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/ps-configurepowershellstep.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions source/BuildPowershellScripts/CreateOctopusRelease.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ param(
[string]$apiKey,
[string]$octopusUrl,
[string]$octopusProjectId,
[string]$nugetPackageVersions = $null # needs to be a JSON array of {StepName, Version} objects. If not provided, we'll try to get the latest
[string]$nugetPackageVersions # needs to be a JSON array of {StepName, Version} objects. If not provided, we'll try to get the latest
)
$octopusHeader = @{ "X-Octopus-ApiKey" = $apiKey }
if (-not $octopusUrl.EndsWith("/")) {$octopusUrl += "/" }
Expand Down Expand Up @@ -78,7 +78,7 @@ $templateUrl = $octoProject.Links.DeploymentProcess + "/template"
$deploymentTemplate = Get-OctopusWebRequest $templateUrl

# Get package versions
if ([string]::IsNullOrEmpty($nugetPackageVersions))
if (-not [string]::IsNullOrEmpty($nugetPackageVersions))
{
$packageVersions = $nugetPackageVersions | ConvertFrom-Json
}
Expand Down
28 changes: 28 additions & 0 deletions source/BuildPowershellScripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Build PowerShell Scripts
========================

PowerShell Scripts that can be used independently or with [Team Build vNext](http://vsalmdocs.azurewebsites.net/library/vs/alm/build/overview)

[Create Octopus Release](CreateOctopusRelease.ps1)
----------------------
Creates a new Release in Octopus Deploy.

### Instructions for use with Team Build vNext:

1. Include the `CreateOctopusRelease.ps1` file in your project or solution

2. Add the *PowerShell* build step to your build definition.

![Add PowerShell Build Step](../../img/ps-addpowershellstep.png)

3. Set the *Script filename* field by locating the `CreateOctopusRelease.ps1` file in your repository

4. Set the following parameters in the *Arguments* field:

`-apiKey API-LNVK9KXXXXXXXXXXXOAYZS -octopusUrl http://my-octopus-server -octopusProjectId projects-1`

* **`-apiKey`** - Your API Key (See [documentation](http://docs.octopusdeploy.com/display/OD/How+to+create+an+API+key) for details on how to create an API Key)
* **`-octopusUrl`** - The URL that points to your Octopus Deploy server
* **`-octopusProjectId`** - The Id of the project you want to create a release for

![Configure PowerShell Build Step](../../img/ps-configurepowershellstep.png)
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function Get-OctoCredentialParameters($serviceDetails) {
return "--apiKey=$pwd"
} else {
$un = $serviceDetails.Authorization.Parameters.Username
return "--user=`"$un`" --pass=`"$pwd`""
return "--user=$un --pass=$pwd"
}
}

Expand Down
2 changes: 1 addition & 1 deletion source/CustomBuildSteps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Creates a new Release in Octopus Deploy.

![Octopus Connected Service](../../img/tfsbuild-connectedservice2.png)

*Note: You can use either username and password, or an API key in the password field. We'll work out which one you're using.*
*Note: Currently, you should just put an [API key](http://docs.octopusdeploy.com/display/OD/How+to+create+an+API+key) in the password field. We'll add user/pass soon and work out which one you're using.*

3. Add the *Create Octopus Release* custom build step to your build definition.

Expand Down

0 comments on commit d861f76

Please sign in to comment.