0

So I want to have a number of different websites running identical copies of binaries, but with differently transformed config files. These are different regional 'copies' of basically the same website (but connected to different backend DBs etc.)

I have a jenkins job which builds my asp.net site, e.g.; MSBUILD C:\Code\ProjectX\src\Website\adminsite.projectx\adminsite.projectx.csproj /m /p:Configuration=Debug /p:OutputPath=C:\Code\ProjectX\build\Website\adminsite.projectx /t:Rebuild

When that job completes I want it to trigger a transform of the .configs, and a deployment of the binaries. Is there any recommended means of achieving this? Right now there are only 2 different regional versions of the site deployed, each with their own web.config transformation file

I know that I could have each region BUILD its own copy of binaries, and do a straightforward deployment. But both regions will have identical binaries, so it seems like a waste of time for them to both kick off a build...

If both jobs try to build from the same source location msbuild seems to be producing artefacts in sub-folders of that location - so when both are kicked off at the same time they're tripping over eachother...

Any suggestions? :)

For what it's worth msbuild seems to ignore OutputPath when I provide that That would have been ideal because I could just use something like;

/p:OutputPath=c:\Code\ProjectX\Build\$(Configuration)\.... etc.

1 Answer 1

1

I found that least wasteful way is to build (or "prepackage") once and include the trasforms into the artefact for environment-specific transformations and deployment later. Basically you'll have a custom MSBuild project, on build it'll call PipelinePreDeployCopyAllFilesToOneFolder target (less wasteful than Package since we don't need the final .zip) and redirect it with _PackageTempDir property and include all Web.*.config items, then on deploy you'll call the appropriate transform task and deploy via msdeploy sync.

Sign up to request clarification or add additional context in comments.

2 Comments

@plenderj Hey, I'm good, didn't know they use MSBuild or .NET in general at the place you're currently at.
side projest is side project :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.