Skip to content

Instantly share code, notes, and snippets.

@Dalmirog-zz
Created January 11, 2017 14:59
Show Gist options
  • Save Dalmirog-zz/879be7d99bbc657a2dfb0b215f1c5780 to your computer and use it in GitHub Desktop.
Save Dalmirog-zz/879be7d99bbc657a2dfb0b215f1c5780 to your computer and use it in GitHub Desktop.
##CONFIG##
$OctoExe = "" #FULL path of the Octo.exe executable (i.e. c:\tools\octo.exe)
$OutputFolder = "" #Output folder where all packages are dropped
$BuildID = "" #<-- This should be the build ID variable that comes from Jenkins
$OctopusServer = "" #Octopus Server base URL
$OctopusAPIKey = ""#Octopus API Key
##PROCESS##
$FilterPattern = "*$BuildID.nupkg"
$Package = Get-ChildItem -Path $OutputFolder -Filter $FilterPattern
if ($Package -ne $null){
.\Octo.exe push --package $Package.FullName --Server $OctopusServer --apikey $OctopusAPIKey
}
else{
Write-error "No package was found in [$OutputFolder] with the pattern [$FilterPattern]"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment