SIF/1020/SHS/shs-CD.json
{
"Parameters": { "Package": { "Type": "string", "Description": "The path to the Web Deploy package to deploy.", "DefaultValue": "" }, "SiteRoot": { "Type": "string", "DefaultValue": "", "Description": "Root path to the site." }, "SiteName": { "Type": "string", "DefaultValue": "Sitecore", "Description": "The name of the site to be deployed." }, "PackagesTempLocation": { "Type": "String", "Description": "Alternative location to save WDP packages. If left on the default $Env:Temp will be used.", "DefaultValue": "" }, "DownloadLocations": { "Type": "String", "Description": "File with URI and SHA256 hashes of dynamically downloadable WDPs.", "DefaultValue": ".\\downloads.json" } }, "Register": { "ConfigFunction": { "TestPath": "Test-Path", "SelectObject": "Select-Object", "SplitPath": "Split-Path" } }, "Variables": { "Site.Path": "[if(variable('Site.Path.Test'),variable('Site.Path.Default'),variable('Site.Path.Custom'))]", "Site.Path.Default": "[joinpath(environment('SystemDrive'), 'inetpub', 'wwwroot', parameter('SiteName'))]", "Site.Path.Custom": "[joinpath(parameter('SiteRoot'),parameter('SiteName'))]", "Site.Path.Test": "[equal(parameter('SiteRoot'),'')]", "Site.DataFolder": "[joinpath(variable('Site.Path'), 'App_Data')]", "Packages.DownloadLocations.File": "[ReadJson(parameter('DownloadLocations'))]", "Packages.DownloadLocations.File.Test": "[TestPath(Path:Parameter('DownloadLocations'))]", "Package.Download.Identifier": "shs-CD.json", "Package.Download.Location": "[if(variable('Package.Download.Location.Test'),Environment('Temp'),parameter('PackagesTempLocation'))]", "Package.Download.Location.Test": "[equal(parameter('PackagesTempLocation'),'')]", "Package.Download.Object": "[SelectObject(InputObject:variable('Packages.DownloadLocations.File'),ExpandProperty:variable('Package.Download.Identifier'))]", "Package.Download.Uri": "[SelectObject(InputObject:variable('Package.Download.Object'),ExpandProperty:'Uri')]", "Package.Download.Hash": "[SelectObject(InputObject:variable('Package.Download.Object'),ExpandProperty:'Hash')]", "Package.Download.Path": "[JoinPath(variable('Package.Download.Location'),variable('Package.Download.Filename'))]", "Package.Download.Document": "[SplitPath(Path:variable('Package.Download.Uri'),Leaf:true)]", "Package.Download.Filename": "[Split(String:variable('Package.Download.Document'),Characters:'?')]", "Package": "[if(parameter('Package'),parameter('Package'),variable('Package.Download.Path'))]", "Package.Available": "[or(variable('Package.Provided'),not(variable('Packages.DownloadLocations.File.Test')))]", "Package.Provided": "[if(parameter('Package'),parameter('Package'),'')]" }, "Tasks": { "DownloadWDP": { "Description": "Download the WDP and verifies it against the stored hash.", "Type": "DownloadFile", "Params": { "SourceUri": "[variable('Package.Download.URI')]", "DestinationPath": "[variable('Package.Download.Path')]", "Hash": "[variable('Package.Download.Hash')]" }, "Skip": "[variable('Package.Available')]" }, "StopWebsite": { "Description": "Stops the website if it is running.", "Type": "ManageWebsite", "Params": { "Name": "[parameter('SiteName')]", "Action": "Stop" } }, "StopAppPool": { "Description": "Stops the app pool if it is running.", "Type": "ManageAppPool", "Params": { "Name": "[parameter('SiteName')]", "Action": "Stop", "Timeout": 60 } }, "InstallWDP": { "Description": "Syncs the web deploy package with the website.", "Type": "WebDeploy", "Params": { "Verb": "Sync", "Arguments": { "Source": { "Package": "[resolvepath(variable('Package'))]" }, "Dest": "Auto", "enableRule": "DoNotDeleteRule", "SetParam": [ { "Name": "Application Path", "Value": "[parameter('SiteName')]" } ] } } }, "TransformXmlDocuments": { "Type": "TransformXmlDoc", "Params": { "RootDirectoryPath": "[variable('Site.Path')]", "XdtDirectory": "[joinpath(variable('Site.DataFolder'), 'JssXdt')]" } }, "StartAppPool": { "Description": "Starts the app pool.", "Type": "ManageAppPool", "Params": { "Name": "[parameter('SiteName')]", "Action": "Start", "Timeout": 60 } }, "StartWebsite": { "Description": "Starts the website.", "Type": "ManageWebsite", "Params": { "Name": "[parameter('SiteName')]", "Action": "Start" } } } } |