Last active
April 20, 2016 03:45
-
-
Save junxy/d4f34e9e90f95b7ec29ace904259ee96 to your computer and use it in GitHub Desktop.
https://library.octopusdeploy.com/#!/listing octopus deploy step template : Download file from url
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Id": "ActionTemplates-101", | |
"Name": "DownOutputScripts", | |
"Description": "Download file from url", | |
"ActionType": "Octopus.Script", | |
"Version": 4, | |
"Properties": { | |
"Octopus.Action.Package.NuGetFeedId": "feeds-builtin", | |
"Octopus.Action.Script.Syntax": "PowerShell", | |
"Octopus.Action.Script.ScriptSource": "Inline", | |
"Octopus.Action.RunOnServer": "false", | |
"Octopus.Action.Script.ScriptBody": "Write-Output \"v0.1-b20160420\"\n\n#$url = \"http://devres.hjfile.cn/co/as/Output-scripts.json\"\n\n#$output = \"$($OctopusParameters['Octopus.Action[Deploy Site].Output.Package.InstallationDirectoryPath'])\\App_Data\\Output-scripts.json\"\n$output = \"$($OctopusParameters['Octopus.Action[Deploy Site].Output.Package.InstallationDirectoryPath'])\\$($output)\"\n\nWrite-Output \"Downloading.. url: $($url) => output: $($output)\"\n\n$start_time = Get-Date\n\n$wc = New-Object System.Net.WebClient\n$wc.DownloadFile($url, $output)\n#OR\n#(New-Object System.Net.WebClient).DownloadFile($url, $output)\n\nWrite-Output \"Time taken: $((Get-Date).Subtract($start_time).Seconds) second(s)\"\n\n" | |
}, | |
"Parameters": [ | |
{ | |
"Name": "url", | |
"Label": "input url", | |
"HelpText": "download file url", | |
"DefaultValue": "http://devres.hjfile.cn/co/as/Output-scripts.json", | |
"DisplaySettings": { | |
"Octopus.ControlType": "SingleLineText" | |
} | |
}, | |
{ | |
"Name": "output", | |
"Label": "output file path", | |
"HelpText": "save to file path", | |
"DefaultValue": "App_Data\\Output-scripts.json", | |
"DisplaySettings": { | |
"Octopus.ControlType": "SingleLineText" | |
} | |
} | |
], | |
"$Meta": { | |
"ExportedAt": "2016-04-20T03:42:50.088Z", | |
"OctopusVersion": "3.3.3", | |
"Type": "ActionTemplate" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment