Sitecore web deploy package(.scwdp) deployment

Octopus.Script exported 2020-06-19 by bobjwalker belongs to ‘Sitecore’ category.

Step template to deploy Sitecore WDP(Web Deploy Package) package.

Useful links: Sitecore documentation. How to create Sitecore Web Deploy Package by Hugo Santos. How to install Sitecore Web Deploy Package by Hugo Santos.

Parameters

When steps based on the template are included in a project’s deployment process, the parameters below can be set.

Application Path

SCWDP Application Path =

Path, where package should be deployed

Web Admin Connection String

SCWDP Web Admin Connection String =

Connection string to web database

Master Admin Connection String

SCWDP Master Admin Connection String =

Connection string to master database

Core Admin Connection String

SCWDP Core Admin Connection String =

Connection string to core database

Package

SCWDP Package =

Path to .scwdp.zip package or name of package attached to release

Path to MSDeploy Executable

SCWDP MsDeploy Path =

It should be “C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe” with default server setup

Script body

Steps based on this template will execute the following PowerShell script.

try { 
  $applicationPath = $OctopusParameters["SCWDP Application Path"]
  $coreConnection = $OctopusParameters["SCWDP Core Admin Connection String"]
  $masterConnection = $OctopusParameters["SCWDP Master Admin Connection String"]
  $webConnection = $OctopusParameters["SCWDP Web Admin Connection String"] 
  $msDeploy = $OctopusParameters["SCWDP MsDeploy Path"] 
  
  $package = $OctopusParameters["SCWDP Package"]

  $cmd = "`""+$msDeploy+"`" -verb:sync -source:package=`""+$package+"`" -dest:auto -enableRule:DoNotDeleteRule -setParam:`"Application Path`"=`""+$applicationPath+"`" -setParam:`"Core Admin Connection String`"=`""+$coreConnection+"`" -setParam:`"Master Admin Connection String`"=`""+$masterConnection+"`" -setParam:`"Web Admin Connection String`"=`""+$webConnection+"`" -verbose"

  Write-Output $cmd
  cmd.exe /c $cmd
}
catch {
  Write-Error "An error occurred:"
  Write-Error $_
}

Provided under the Apache License version 2.0.

Report an issue

To use this template in Octopus Deploy, copy the JSON below and paste it into the Library → Step templates → Import dialog.

{
  "Id": "9a757194-4c7e-4e9e-a58f-7b0c12b8253a",
  "Name": "Sitecore web deploy package(.scwdp) deployment",
  "Description": "Step template to deploy Sitecore WDP(Web Deploy Package) package. \n\n**Useful links:**\n[Sitecore documentation.](https://doc.sitecore.com/developers/sat/24/sitecore-azure-toolkit/en/web-deploy-packages-for-a-module.html)\nHow to create [Sitecore Web Deploy Package](https://hls-consulting.com/2019/05/15/how-to-create-a-wdp-from-a-sitecore-package/)  by Hugo Santos. \nHow to install [Sitecore Web Deploy Package](https://hls-consulting.com/2019/06/03/how-to-install-a-wdp-in-a-sitecore-9-1-on-premises-instance/) by Hugo Santos.\n\n",
  "Version": 5,
  "ExportedAt": "2020-06-19T05:40:59.376Z",
  "ActionType": "Octopus.Script",
  "Author": "bobjwalker",
  "Packages": [],
  "Parameters": [
    {
      "Id": "8a064359-6d40-472d-8839-383eb886e1e4",
      "Name": "SCWDP Application Path",
      "Label": "Application Path",
      "HelpText": "Path, where package should be deployed",
      "DefaultValue": "",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Id": "02031f37-6b13-4c58-95c0-b160f02193c7",
      "Name": "SCWDP Web Admin Connection String",
      "Label": "Web Admin Connection String",
      "HelpText": "Connection string to web database",
      "DefaultValue": "",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Id": "95f75e2e-4679-403a-b1c8-dea0e529614a",
      "Name": "SCWDP Master Admin Connection String",
      "Label": "Master Admin Connection String",
      "HelpText": "Connection string to master database",
      "DefaultValue": "",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Id": "bc921038-1de9-4d6d-9492-b27f291b25c5",
      "Name": "SCWDP Core Admin Connection String",
      "Label": "Core Admin Connection String",
      "HelpText": "Connection string to core database",
      "DefaultValue": "",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Id": "0754e1e3-ee10-41fc-b198-3cc1d945ea13",
      "Name": "SCWDP Package",
      "Label": "Package",
      "HelpText": "Path to .scwdp.zip package or name of package attached to release",
      "DefaultValue": "",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Id": "c91f4571-1e61-4f0f-82e4-2dcea7024506",
      "Name": "SCWDP MsDeploy Path",
      "Label": "Path to MSDeploy Executable",
      "HelpText": "It should be \"C:\\Program Files (x86)\\IIS\\Microsoft Web Deploy V3\\msdeploy.exe\" with default server setup",
      "DefaultValue": "",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    }
  ],
  "Properties": {
    "Octopus.Action.Script.ScriptSource": "Inline",
    "Octopus.Action.Script.Syntax": "PowerShell",
    "Octopus.Action.Script.ScriptBody": "try { \n  $applicationPath = $OctopusParameters[\"SCWDP Application Path\"]\n  $coreConnection = $OctopusParameters[\"SCWDP Core Admin Connection String\"]\n  $masterConnection = $OctopusParameters[\"SCWDP Master Admin Connection String\"]\n  $webConnection = $OctopusParameters[\"SCWDP Web Admin Connection String\"] \n  $msDeploy = $OctopusParameters[\"SCWDP MsDeploy Path\"] \n  \n  $package = $OctopusParameters[\"SCWDP Package\"]\n\n  $cmd = \"`\"\"+$msDeploy+\"`\" -verb:sync -source:package=`\"\"+$package+\"`\" -dest:auto -enableRule:DoNotDeleteRule -setParam:`\"Application Path`\"=`\"\"+$applicationPath+\"`\" -setParam:`\"Core Admin Connection String`\"=`\"\"+$coreConnection+\"`\" -setParam:`\"Master Admin Connection String`\"=`\"\"+$masterConnection+\"`\" -setParam:`\"Web Admin Connection String`\"=`\"\"+$webConnection+\"`\" -verbose\"\n\n  Write-Output $cmd\n  cmd.exe /c $cmd\n}\ncatch {\n  Write-Error \"An error occurred:\"\n  Write-Error $_\n}"
  },
  "Category": "Sitecore",
  "HistoryUrl": "https://github.com/OctopusDeploy/Library/commits/master/step-templates//opt/buildagent/work/75443764cd38076d/step-templates/sitecore-deploy-scwdp.json",
  "Website": "/step-templates/9a757194-4c7e-4e9e-a58f-7b0c12b8253a",
  "Logo": "iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAMAAACahl6sAAAAGXR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