Skip to content

Instantly share code, notes, and snippets.

@keyan1603
Created September 20, 2023 18:16
Show Gist options
  • Save keyan1603/36523d3c9b6a7388ebc6c055c0192535 to your computer and use it in GitHub Desktop.
Save keyan1603/36523d3c9b6a7388ebc6c055c0192535 to your computer and use it in GitHub Desktop.
Build Sitecore solution using powershell
RUN Get-ChildItem .\src\Foundation\ –Recurse –Include *.csproj | ForEach-Object { msbuild $_.FullName /p:Configuration=$env:BUILD_CONFIGURATION /p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:PublishUrl=C:\out\website };
RUN Get-ChildItem .\src\Feature\ –Recurse –Include *.csproj | ForEach-Object { msbuild $_.FullName /p:Configuration=$env:BUILD_CONFIGURATION /p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:PublishUrl=C:\out\website };
RUN Get-ChildItem .\src\Project\ –Recurse –Include *.csproj | ForEach-Object { msbuild $_.FullName /p:Configuration=$env:BUILD_CONFIGURATION /p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:PublishUrl=C:\out\website };
#OR
RUN msbuild .\MySitecore.sln /p:Configuration=$env:BUILD_CONFIGURATION /p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:PublishUrl=C:\out\website
# Copy final build artifacts
COPY --from=builder C:\out\website .\website\
COPY --from=builder C:\out\transforms .\transforms\
#COPY --from=builder C:\out\xconnect .\xconnect\
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment