views:

20

answers:

2

Hey guys, So I recently got a VPS, just so I can start gaining experience. But I'm looking for a service/program where I can code on my PC, then when I'm done, I run a script or do a command or something to have it updated to my VPS.

I thought I was looking for Git, but apparently git does not do what I'm looking for.

Any suggestions?

A: 

"rsync" or "scp" tools may be useful

Kel
A: 

Windows or Linux?

On Windows, there's a host of tools.

First of all you code. Visual Studio is the most common. You get a sln-file and a batch of *.*proj-files.

When talking about deploying to remote servers, often a continuous integration server is used. We are using TeamCity (http://www.jetbrains.com/teamcity/). Download it locally, install and create a new project, selecting the "SLN-runner". Point it to the sln file of yours.

When you want the deployment part working, create a small build file such as "MyProj.build", that contains something along the lines of

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="BuildProject" 
         InitialTargets="CheckRequiredProperties" 
         xmlns="http://schemas.microsoft.com/developer/msbuild/2003" 
         ToolsVersion="4.0">

<Target Name="BuildProject">

    <Message Text="Starting $(Configuration) build. Web site publish location $(OutputWebSite)" />

    <MSBuild Projects="$(SolutionPath)" 
             Targets="Build"
             Properties="BuildOutputPath=$(BuildOutputPath);
                BuildOutputPathBin=$(BuildOutputPathBin);
                Configuration=$(Configuration);
                BuildConstants=$(BuildConstants);
                MSBuildTargets=$(MSBuildTargets);
                TargetFrameworkVersion=$(TargetFrameworkVersion);
                TargetFrameworkProfile=$(TargetFrameworkProfile)">
...

Where SolutionPath points to your sln-file.

You will then update the TeamCity config to point to MyProj.build instead, using the MsBuild runner.

Then you need a way of having TeamCity upload everything to your server. Powershell is a nice scripting environment that can run .Net code, but you'd be invoking it through MsBuild...

Something like this http://community.bartdesmet.net/blogs/bart/archive/2008/02/16/invoking-powershell-scripts-from-msbuild.aspx

And then you can script with MsDeploy accross to your server: http://blogs.iis.net/jamescoo/archive/2008/08/21/using-msdeploy-in-powershell.aspx

Henrik

related questions