Skip to content

Instantly share code, notes, and snippets.

@adoprog
Created April 19, 2013 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adoprog/5418727 to your computer and use it in GitHub Desktop.
Save adoprog/5418727 to your computer and use it in GitHub Desktop.
Copy Sitecore files to solution.
properties {
$distributivePath = "%path to storage%\Sitecore 6.6.0 rev. 130111.zip"
$localStorage = "C:\LocalStorage"
$distributiveName = [System.IO.Path]::GetFileNameWithoutExtension($distributivePath)
$zipFile = "$localStorage\$distributiveName.zip"
$buildFolder = Resolve-Path ..
$revision = "12345"
$buildNumber = "1"
}
task Init {
if (-not (Test-Path $localStorage)) {
New-Item $localStorage -type directory -Verbose
}
if (-not (Test-Path $zipFile)) {
Copy-Item $distributivePath $zipFile -Verbose
}
if (-not (Test-Path $localStorage\$distributiveName)) {
sz x -y "-o$localStorage" $zipFile "$distributiveName/Website"
sz x -y "-o$localStorage" $zipFile "$distributiveName/Data"
}
if (Test-Path "$buildFolder\output") {
Remove-Item -Recurse -Force "$buildFolder\output"
}
New-Item "$buildFolder\output" -type directory
robocopy $localStorage\$distributiveName $buildFolder /E /XC /XN /XO
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment