{
  "Id": "993b2b9a-05a4-4dbd-b5b7-3dc0358acac8",
  "Name": "Unicorn - Sync Configuration",
  "Description": "Sync Unicorn items",
  "ActionType": "Octopus.Script",
  "Version": 8,
  "Properties": {
    "Octopus.Action.Script.ScriptBody": "$url = \"$BaseUrl/unicorn.aspx?verb=Sync&configuration=$ConfigName\"\r\nWrite-Host \"Syncing configuration: $ConfigName\"\r\nWrite-Host \"Attempting to invoke: $url\"\r\n$deploymentToolAuthToken = $DeploymentAuthToken\r\n$timeout = $Timeout\r\n$basicAuthUser = $BasicAuthUsername\r\n$basicAuthPass = $BasicAuthPassword\r\n$secpasswd = ConvertTo-SecureString $basicAuthPass -AsPlainText -Force\r\n$credential = New-Object System.Management.Automation.PSCredential($basicAuthUser, $secpasswd)\r\n$result = Invoke-WebRequest -Uri $url -Headers @{ \"Authenticate\" = $deploymentToolAuthToken } -TimeoutSec $timeout -UseBasicParsing \r\n\r\nWrite-Host $result.Content",
    "Octopus.Action.Script.Syntax": "PowerShell"
  },
  "SensitiveProperties": {},
  "Parameters": [
    {
      "Name": "BaseUrl",
      "Label": "Base Url",
      "HelpText": "e.g. http://mywebsite.com.au/ - This should be where you'd normally manually sync Unicorn",
      "DefaultValue": null,
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Name": "ConfigName",
      "Label": "Configuration Name",
      "HelpText": "e.g. Default Configuration",
      "DefaultValue": null,
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Name": "Timeout",
      "Label": "Timeout",
      "HelpText": "The timeout for the Web-Invoke method",
      "DefaultValue": "10800",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Name": "DeploymentAuthToken",
      "Label": "Deployment Auth Token",
      "HelpText": "The auth token used to authenticate this request.\nThis should be in your web.config appSettings as DeploymentToolAuthToken.",
      "DefaultValue": null,
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Name": "BasicAuthUsername",
      "Label": "Basic Auth Username",
      "HelpText": "Fill this in if the target site is behind basic auth",
      "DefaultValue": "",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Name": "BasicAuthPassword",
      "Label": "Basic Auth Password",
      "HelpText": "Fill this in if the target site is behind basic auth",
      "DefaultValue": "",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    }
  ],
  "LastModifiedOn": "2015-09-04T05:09:05.695+00:00",
  "LastModifiedBy": "elkaz",
  "$Meta": {
    "ExportedAt": "2015-09-07T02:20:43.772+00:00",
    "OctopusVersion": "2.6.3.886",
    "Type": "ActionTemplate"
  },
  "Category": "sitecore"
}
