Octopus.Script exported 2015-07-09 by matt40k belongs to ‘Jasper’ category.
Clears the Jasper web cache
Parameters
When steps based on the template are included in a project’s deployment process, the parameters below can be set.
Server Name
fqdn = server
Enter the server name of your Jasper web server
Environment
environment = dev
Enter the environment
Username
username = username
Enter the username to authenticate.
Password
password =
Enter the password
Script body
Steps based on this template will execute the following PowerShell script.
# Name: ClearCache.ps1
# Author: Matt Smith
# Created Date: 28 July 2014
# Modified Date: 13 October 2014
# Version: 1.3
$servers = $OctopusParameters['fqdn'] -split ";"
foreach ($server in $servers)
{
Write-Host 'Clearing cache in '$server
$url = 'http://' + $server + '/' + $OctopusParameters['environment'] + '_web/report/meta'
Function ClearCache($type)
{
return Invoke-WebRequest -Uri $url/$type -Method GET -Headers @{"Authorization" = "Basic "+[System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($OctopusParameters['username']+":"+$OctopusParameters['password'] ))}
}
# Clear cache
$reportresult = ClearCache -type 'reportcache?CLEAR=Clear+Cache'
$templateresult = ClearCache -type 'templatecache?CLEAR=Clear+Cache'
$imageresult = ClearCache -type 'imagescache?CLEAR=Clear+Cache'
}
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": "a9fd43af-257e-49c9-9434-618568e1df52",
"Name": "Clear Jasper Web-Cache",
"Description": "Clears the Jasper web cache",
"Version": 3,
"ExportedAt": "2015-07-09T12:17:59.666+00:00",
"ActionType": "Octopus.Script",
"Author": "matt40k",
"Parameters": [
{
"Name": "fqdn",
"Label": "Server Name",
"HelpText": "Enter the server name of your Jasper web server",
"DefaultValue": "server",
"DisplaySettings": {
"Octopus.ControlType": "SingleLineText"
}
},
{
"Name": "environment",
"Label": "Environment",
"HelpText": "Enter the environment",
"DefaultValue": "dev",
"DisplaySettings": {
"Octopus.ControlType": "SingleLineText"
}
},
{
"Name": "username",
"Label": "Username",
"HelpText": "Enter the username to authenticate.",
"DefaultValue": "username",
"DisplaySettings": {
"Octopus.ControlType": "SingleLineText"
}
},
{
"Name": "password",
"Label": "Password",
"HelpText": "Enter the password",
"DefaultValue": "",
"DisplaySettings": {
"Octopus.ControlType": "SingleLineText"
}
}
],
"Properties": {
"Octopus.Action.Script.ScriptBody": "# Name: ClearCache.ps1\n# Author: Matt Smith\n# Created Date: 28 July 2014\n# Modified Date: 13 October 2014\n# Version: 1.3\n\n$servers = $OctopusParameters['fqdn'] -split \";\"\n\nforeach ($server in $servers)\n{\n Write-Host 'Clearing cache in '$server\n $url = 'http://' + $server + '/' + $OctopusParameters['environment'] + '_web/report/meta'\n\n Function ClearCache($type)\n { \n return Invoke-WebRequest -Uri $url/$type -Method GET -Headers @{\"Authorization\" = \"Basic \"+[System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($OctopusParameters['username']+\":\"+$OctopusParameters['password'] ))}\n }\n \n # Clear cache\n $reportresult = ClearCache -type 'reportcache?CLEAR=Clear+Cache'\n $templateresult = ClearCache -type 'templatecache?CLEAR=Clear+Cache'\n $imageresult = ClearCache -type 'imagescache?CLEAR=Clear+Cache'\n\n}",
"Octopus.Action.Script.Syntax": "PowerShell"
},
"Category": "Jasper",
"HistoryUrl": "https://github.com/OctopusDeploy/Library/commits/master/step-templates//opt/buildagent/work/75443764cd38076d/step-templates/jasper-clear-cache.json",
"Website": "/step-templates/a9fd43af-257e-49c9-9434-618568e1df52",
"Logo": "iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAMAAACahl6sAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAYBQTFRF////AGGijKvS+Pr8FGuptMri0dztmrrZ1eDvG3GtutLmxdToZJrF3OXxSYq8hK3RlrHWkK3TIXOu8fX57fH4K3uyoLnaMnqzjazTtMfhirLU9vj7vc3l/P3+QYq7mbTXAGKjXJTCDGinU46/wdLncqPLM4C2yNbpocPdrcjhnbbYBmSk6e72Cmal6/D3bpzIAGOkAGWl4ejzqL7c9Pb6+/v9przc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