Octopus.Script exported 2017-01-12 by olcay belongs to ‘Medianova’ category.
Allows to purge content using Medianova CDN Purge App
Parameters
When steps based on the template are included in a project’s deployment process, the parameters below can be set.
Username
username
Username of the user with purge priviliges
Password
pass
Password of the user
File Names
fileList
A row seperated list of files to purge.
Sample; /folder-1/file-1.jpg
Script body
Steps based on this template will execute the following PowerShell script.
$username = $OctopusParameters['username']
$pass = $OctopusParameters['pass']
$fileList = $OctopusParameters['fileList']
Try
{
foreach($file in $fileList.Split("`n")){
"https://purge.mncdn.com/?username=$username&pass=$pass&file=$file"
$result = Invoke-WebRequest -UseBasicParsing -Uri "https://purge.mncdn.com/?username=$username&pass=$pass&file=$file"
}
}
catch [Exception] {
"Error, couldn't finish purge operation. `r`n $_.Exception.ToString()"
}
Provided under the Apache License version 2.0.
To use this template in Octopus Deploy, copy the JSON below and paste it into the Library → Step templates → Import dialog.
{
"Id": "dce70842-466e-4ae7-acd4-9aa18bfac065",
"Name": "Medianova - Purge",
"Description": "Allows to purge content using Medianova CDN Purge App",
"Version": 0,
"ExportedAt": "2017-01-12T12:04:56.746Z",
"ActionType": "Octopus.Script",
"Author": "olcay",
"Parameters": [
{
"Id": "f633ea69-cf1c-4990-be60-a1efc0162851",
"Name": "username",
"Label": "Username",
"HelpText": "Username of the user with purge priviliges",
"DefaultValue": null,
"DisplaySettings": {
"Octopus.ControlType": "SingleLineText"
},
"Links": {}
},
{
"Id": "44be4cbd-f9e7-4f42-a6ed-627a56d31e8d",
"Name": "pass",
"Label": "Password",
"HelpText": "Password of the user",
"DefaultValue": null,
"DisplaySettings": {
"Octopus.ControlType": "Sensitive"
},
"Links": {}
},
{
"Id": "67f5c81a-1559-4359-a920-e5cd48b5940d",
"Name": "fileList",
"Label": "File Names",
"HelpText": "A row seperated list of files to purge.\n\nSample;\n/folder-1/file-1.jpg",
"DefaultValue": null,
"DisplaySettings": {
"Octopus.ControlType": "MultiLineText"
},
"Links": {}
}
],
"Properties": {
"Octopus.Action.Script.Syntax": "PowerShell",
"Octopus.Action.Script.ScriptSource": "Inline",
"Octopus.Action.RunOnServer": "false",
"Octopus.Action.Script.ScriptBody": "$username = $OctopusParameters['username']\n$pass = $OctopusParameters['pass']\n$fileList = $OctopusParameters['fileList']\n\nTry \n{\n foreach($file in $fileList.Split(\"`n\")){\n \"https://purge.mncdn.com/?username=$username&pass=$pass&file=$file\"\n $result = Invoke-WebRequest -UseBasicParsing -Uri \"https://purge.mncdn.com/?username=$username&pass=$pass&file=$file\"\n }\n}\ncatch [Exception] {\n\t\"Error, couldn't finish purge operation. `r`n $_.Exception.ToString()\"\n}",
"Octopus.Action.Script.ScriptFileName": null,
"Octopus.Action.Package.FeedId": null,
"Octopus.Action.Package.PackageId": null
},
"Category": "Medianova",
"HistoryUrl": "https://github.com/OctopusDeploy/Library/commits/master/step-templates/medianova-purge.json",
"Website": "/step-templates/dce70842-466e-4ae7-acd4-9aa18bfac065",
"Logo": "iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAIAAAC1nk4lAAAACXBIWXMAAA9hAAAPYQGoP6dpAAANRUlEQVRo3sVaCXNUVRb2twwJQkg6W2ffTBzCEgyoMOI4BkVAHHFcsGSknBELB4yOog7KFOPo6OAwqAVoUYpsCSFbZyH7vpOtk3SWTncnnd7OfOfd192v1yRNRlK3Ui8v79373XO/c8537rv3kevHZqMFC82baU60OTKZ+AJ3LFayW8lBcrPYaN5KZgvZ7ER28bb4j3Rl5+fxX2U/pnn5mps56LXyzhzNS/cXpLHkAeg+N2iL1VpVa796nX4W7Rq3y1dxx66pJtMcWWXc84PDs0Wl5us3aWiE+8V9Cbrcp91undANl5Ubim7ZrhY5u3J2KF9fD3ztvHNF/L6GThaqa9kQLtBuC5nmqnbtLVOn1cSl1sYkuVpZXPLltCwqq+QZOyRD9g9eyM27lpJVtuVhKiklg5FsVr4vgNvttLDQcubs2ZzcG0mZlfEpyt5qYxM8/vRpddHcXH9q4lKKEjNaXjnEViNf0LOG3see7F8Tow1TTayKklvYuqH7VW2R6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1D0FzhL1wSd6RW4QeBqPpyLHGqHioDuRwrw9Fvp+OgtzXKaRPKKI0NgkymKss+6KgkX7+daY6LonLqnsHWt7e7e732t4NABrLoam5kZSBmi90etyd8BeitDo1m2WZb1Lxv2s6MX1z23akvXsFWkji9q2/CSRKPcot1yfK0Y9Ownm9vsT9Yk3SlTEjCNKSKPVIKwrDK0DzhqKFunrL03JEitH94llGbNIajxxVnjnwC9qZxsku9jyNhSd8zg2EuB+3XKqwooxJoFOnlWcOgmoPYe/5BRrW1v726UZVkpBHoZNk+aCxwpXxKfx13bQk0MrvthZq66rKe6Q51E3Eu9nevQlRiiCtOHPgPjvlCARaPIR3Glrqtj+OwhsRkE2+KvIXAM1nDlKzqOeOhygNDtqhtDdwj4wOvXWsKDlTbCyt1A5BENpAlN7YkMcf3hVnDnwD9n0BHFQcZbNwXVhSObj/hfL4tProJIhGGL5/DX+6xTSCbzWFABr91z61lyY9t3eDg/YmiU368AOTI9Q3tY19eLJiZwF/aIxL462ciDjl8Qqls46FrRtzHiVarijtPHSYz7gE0HdLAO1QftCQDoDBBi1ddO78/NuFQ/t+37blUU1yliYuBSESKgdNnEuTrhc5yua3XUnJ7D55SvoqYvUtWPwdcQsczN0H18QRScQjBH+IdLTpWRoYoqYWqtDwRx3XOcDLVxc7NOjn2ny9iPr62cwOezBLLwm0uOGvXJNZJM69zZsXO5K52PW8xX3YLPDP/wBTT3BVqNUZhQAAAABJRU5ErkJggg==",
"$Meta": {
"Type": "ActionTemplate"
}
}
Page updated on Thursday, January 12, 2017