RubbleFord
RubbleFord

Reputation: 7636

Teamcity MSBuild Copy build output to new folder

I've managed to get Teamcity running and connecting into bitbucket and the final step I'd like would be to get the MVC 4 project copied into another folder on the server ready for an xcopy deployment onto a web host.

I'm using MSBUILD, as the build agent.

Thanks in advance.

Upvotes: 2

Views: 8773

Answers (3)

JrBriones
JrBriones

Reputation: 93

Under general settings

Click "Show advanced options"

Under Artifact Paths you can specify what you would like put under a new folder

**/* => target_directory

Or you can zip up your files and put under a new folder like this

**/* => newfolder/mypackage.zip

See more details here: https://www.jetbrains.com/help/teamcity/2019.2/configuring-general-settings.html#ConfiguringGeneralSettings-ArtifactPaths

Upvotes: 0

Aleš Roubíček
Aleš Roubíček

Reputation: 5189

Preferred way is to use publishing targets in MSBuild.

  1. Add new build step with runner type MSBuild
  2. Set Build file path to your web project csproj file
  3. Set Target to Clean;Build;Publish
  4. Set Command line parameters to /p:Configuration=Release;PublishDir=\\your\target\path

Hope this helps.

Upvotes: 6

Mathias F
Mathias F

Reputation: 15891

You could use the CommandLine buildrunner to xcopy. Personally I would not even copy the result to a different server.

For deployment I would have a deployment project in Teamcity that gets the required artifcat via wget from the Teamcity Rest-Api and uploads it to the hosting provider. This can also be done in CommandLine buildrunner.

Upvotes: 0

Related Questions