Deployment strategy howto best practice

Hi
i have varioius projects and i would like to know best practice, since i am new to teamcity.
i use git and usually have a master and a development branch.

I would like to deploy master branch changes via ftp or ssh to a remote server (depending on what data i get from owner, customer). That is sofar no problem.

On the same server where teamcity is running i have a dev-apache where i have a dev-instance of the project (for testing, beta etc).
So i want to deploy changes in the development branch to a folder on the same server.

I could do that as a post-receive hook in git.
but i think it is better to have it as a part of a build configuration because i can do optional teste before that.

Can somebody give me some hints how to set this kind of a post-receive hook in my build configuration?
thx

3 comments
Comment actions Permalink

Hi,

To achieve it you can add command line build step which deploys changes to a folder on the same machine.

0
Comment actions Permalink

So i would do a git commit command to the local folder?

0
Comment actions Permalink

Yes. If you want to deploy only new and changed files (not build artifacts) you can create a TeamCity build step with the git checkout command. To make sure that build revision is the same as deployed one, you can use build parameter build.vcs.number in git checkout command.

0

Please sign in to leave a comment.