Burak Erdem
Burak Erdem

Reputation: 19969

Deploying with Git/Github

We are trying to setup an automated deployment environemt with Git/Github. We have 3 different environments; local, test and live. When we add a new feature on local, we first upload files to test server to test the newly created feature. If everything is OK, we than upload all files to live server. But this "uploading" process is not a perfect solution, as we sometimes forget to upload some files. Btw we also have mobile app on iPhone and Android, so mobile may be the fourth environment for us.

What we try to do is to setup an automated deployment environment. When we commit a new feature to test server, after testing this new feature we want to push it to live server.

There may be lots of commits on the test server but we want to push specific commits to live server. We couldn't find how to cope with 3-4 environments and not to mess codes. How will we push correct codes to live server? How will we manage our test and live servers? Are there any good recources telling how to setup different environments and deployment processes with Git/Github? Are there any articles to tell us what to do step-by-step?

I've read those articles but none of them tell how to cope with local, test and live environments.

EDIT 2012-03-09: I've found http://beanstalkapp.com/ and http://springloops.com and they both seem very good at deployment. I'm not sure if I can trust those services but they both do exactly what I want. I will test both and share my results here to inform everyone.

Upvotes: 19

Views: 17775

Answers (5)

jesal
jesal

Reputation: 7938

I ended up creating my own rudimentary deployment tool which would automatically pull down new updates from the repo - https://github.com/jesalg/SlimJim - I don't think it will fit your needs exactly but you can read how it's setup and maybe you might get some ideas out of it.

Upvotes: 2

Burak Erdem
Burak Erdem

Reputation: 19969

I've finally found what I was looking for. http://beanstalkapp.com seems the best choice. It has automatic deployment feature and supports Git. After testing it for a week, I can say that it works very stable and fast. Thanks everyone for helping me and trying to show me the way.

Upvotes: 8

managedheap84
managedheap84

Reputation: 851

I'm currently using git in such a way and just posted a blog article about here.

What I usually do is use a post-receive hook to look for commits pushed into a release branch, and when found deploys the codebase using the git archive command.

This is fine for small projects, if you have multiple developers working on a project or it's a large and complex codebase I do recommend the use of a Continuous Integration system like Jenkins as suggested in a previous comment.

Have a look at this and see if it suits your needs (includes a simple bash deployment script)

Cheers

Upvotes: 0

Wes Hardaker
Wes Hardaker

Reputation: 22252

Whether or not git is the right choice, is a good question.

But if you're going to do it you should read through the gitworkflows manual page. Specifically, what it'll recommend and what sounds right given your problem above is that you need to put each separate "thing" to be developed into a topic/feature branch, and then merge that branch into the right tree when its done. That lets you separate out things so that you merge what is needed and stable and don't merge what isn't.

Upvotes: 2

James Andres
James Andres

Reputation: 1532

It sounds like you need a Continuous Integration system. I have had great success with both Jenkins and Webistrano.

With regard to the "what files should we copy?" problem. Are you using git tags yet? If not, start using them!

Upvotes: 4

Related Questions