Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $OctopusPackage = get-item $OctopusParameters['Octopus.Tentacle.CurrentDeployment.PackageFilePath']
- #Octopus adds a GUID to the package name when it drops them on disk (i.e MyPackage.20160309.10.nupkg-e9ba4f11-9303-485f-8abc-6ea6c3776588), so you need to get your hands a bit dirty to clean it up:
- #Dir where the package with the clean name will be dropped
- $CopyDir = "C:\TempPackages"
- If(!(Test-Path $CopyDir)){
- New-Item $CopyDir -ItemType Directory -verbose
- }
- #building string of full path of the package you'll be uploading
- $PackageToUploadPath = (Join-Path -path $CopyDir -childpath (($OctopusPackage.Name -split "nupkg")[0] + "nupkg"))
- #Creating the copy with the right name
- Copy-Item -Path $OctopusPAckage.FullName -Destination $PackageToUploadPath -Verbose -Force
- #Here do your magic to push the package to azure using $PackageToUploadPath
- #Finally delete the copy on disk with the clean name to avoid taking too much space
- #Remove-Item $PackageToUploadPath -Verbose
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement