Welcome Guest, Not a member yet? Register   Sign In
straightforward single developer deployment with mercurial and netbeans?
#1

[eluser]neomech[/eluser]
I am coding a website using Codeigniter, and things are going well, but I'm having some issues figuring out how best to work with mercurial and/or netbeans when it comes to moving stuff from development to testing or live. I've seeen a few threads on this here but they don't appear to answer my question.

Here's my situation:

I am using mercurial for version control.

I have 3 systems I work with. I do my coding on a Windows 7 machine using Netbeans 6.9.1. I am occasionally making commits, and pushing to a repository at Bitbucket.org, purely for the purposes of backup and version control.

I have a "beta" website (on a shared Linux box with it's own dedicated IP address) that I upload to via FTP, where I can test that everything is working as intended on an actual site running Linux.

Once I'm happy with that, I upload to my "live" site, which is on it's own dedicated server. Again I'm just using FTP to upload the files from my development server.

I realize that this is all kinds of wrong. For one thing I have to go in and change the config, database and constants files on the beta and live machines so that they're referring to the correct domain name, instead of localhost. For another, I'm not making use of mercurial at all to help with this. I assume instead of uploading from FTP, I could be using mercurial to "grab" a particular revision that I've marked as ready to deploy. I also think I could possibly be doing something in Netbeans differently to make the process easier.

What I want to do is have some very smoothe way to control all this, and hopefully one that makes it so I don't have to keep changing the same 3 files every time I move off the localhost machine.

Is there a standard way to do what I'm looking for? I've seen references to some third party apps for "continuous integration" but I'm not sure I need anything like that.

I'm a little lost as to what would be the SIMPLEST thing for me to do that would make my life easier, I suspect it involves using mercurial in a way that's more advanced than my current hg knowledge. Any help greatly appreciated Smile Thanks!
#2

[eluser]n0xie[/eluser]
What you are really looking for is a 'work flow', a way to incorporate your code repository with your development process.
These two sites will give you some pointers:
http://nvie.com/posts/a-successful-git-branching-model/
http://philsturgeon.co.uk/news/2010/02/D...s-with-Git

Even though the work flow is designed for git it is trivial to implement it for mercurial. Basically what you want is 3 branches:
- develop
- release(-candidate) / testing
- master

You commit all your changes to the development branch. Once you have a bunch of changes that combined form a release(-candidate), you merge them in your release branch. Once this is tested and is satisfactory, you merge it in your 'live' branch, usually called 'master'.

All your environments are remote repositories so updating your site should be similar to this:
Code:
hg push beta release // push the current release branch to the beta server
hg push live master // push the current master branch to the live server

The only trick is to exclude your config files from the repository. This way whenever you update, your config isn't overwritten. (in CI this would usually be the index.php (for error level), config.php and database.php). You will have to manually create them the first time, but that's it.
#3

[eluser]neomech[/eluser]
Those are some good starting suggestions. Thanks very much! Smile




Theme © iAndrew 2016 - Forum software by © MyBB