Sitecore / Sitecore.Rocks

Sitecore Rocks is a plugin for Visual Studio for Sitecore developers.
Other
75 stars 27 forks source link

Instructions for Docker install from update package #145

Open nickwesselman opened 4 years ago

nickwesselman commented 4 years ago

Quick POC shows it's possible to install the Hard Rocks service from an update package downloaded from GitHub. This should be documented somewhere here in the repo.

CM Dockerfile would need to use multi-stage to avoid installing Rocks in prod, and would look something like this:

FROM ${BASE_IMAGE} as cm-base

# Add solution files, modules, tooling, etc here

# Debug/development stage with Sitecore Rocks enabled
FROM cm-base as debug
RUN mkdir 'c:\\temp'; `
    $rocksDownload = 'c:\\temp\\SitecoreRocksServer.zip'; `
    Invoke-WebRequest "https://github.com/Sitecore/Sitecore.Rocks/releases/download/4.0.291/Sitecore.Rocks.Server.update" -UseBasicParsing -OutFile $rocksDownload; `
    if ((Get-FileHash $rocksDownload).Hash -ne '416F40F8ED4CA2F1E9599B3B4FFBBA66B88593F396A1097410C93EC36D6E009D') { `
        Remove-Item $rocksDownload -Force; `
        throw "Invalid Sitecore Rocks artifact"; `
    } `
    Expand-Archive $rocksDownload -DestinationPath 'c:\\temp\\SitecoreRocksServer'; `
    Expand-Archive 'c:\\temp\\SitecoreRocksServer\\package.zip' -DestinationPath 'C:\\temp\\SitecoreRocksServer' -ErrorAction SilentlyContinue; `
    if (-not (Test-Path 'C:\\temp\\SitecoreRocksServer\\addedfiles')) { `
        throw "Rocks extract failed"; `
    } `
    Copy-Item 'c:\\temp\\SitecoreRocksServer\\addedfiles\\*' -Destination 'C:\\inetpub\\wwwroot' -Recurse -Force -Verbose; `
    Remove-Item 'c:\\temp\\SitecoreRocksServer*' -Recurse;

FROM cm-base as release