Skip to content

Instantly share code, notes, and snippets.

@phillijw
Created February 16, 2017 19:41
Show Gist options
  • Save phillijw/bf86354a3154ce7f98e740200f872323 to your computer and use it in GitHub Desktop.
Save phillijw/bf86354a3154ce7f98e740200f872323 to your computer and use it in GitHub Desktop.
An example of how you might write a simple build script with msbuild compatible with C# 6
@echo off
"C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe" ../MEDIC.Web.csproj /t:rebuild;package /p:Configuration=Release /p:EnvConfig="Production"
if errorlevel 1 goto errorDone
echo Build successful
robocopy ../bin/ ../obj/Release/Package/PackageTmp/ Web.config
echo Copied transformed Web.config
robocopy ../obj/Release/Package/PackageTmp/ \\web2a\C$\inetpub\medic.mywebsite.com *
robocopy ../obj/Release/Package/PackageTmp/ \\web2b\C$\inetpub\medic.mywebsite.com *
echo Copied files successfully
goto success
:errorDone
color 02
echo Build failed. Not copying files
:success
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment