2

I am working on setting up a development/deploy cycle for one of our latest projects. Here is what I am trying to do,

  1. Commit the latest code to local "mercurial" clone.
  2. Push it to central repo hosted at "bitbucket"
  3. Open some web based management console (this is the part I need help with) on my server, which is already configured to use the bitbucket repo automatically fetches the latest commits and shows a list.
  4. Choose one of the revisions and perform an update which will effectively update the website.
  5. If there are some issues with the latest revision, go back to previous version using the same web console.

I am using "SourceTree" for step1 and step2 and I want to keep the whole cycle GUI based. Can anyone suggest any tool which I can use for the server side management (step 3,4,5) ?

Jim Jose
  • 1,319
  • 11
  • 17
  • I assume you've read about [the usual way it's done](http://stevelosh.com/blog/2009/01/deploying-site-fabric-and-mercurial/)? If you simply push from your local repo directly to the repo on the deployed website, this covers #3 and #4. Not #5, alas. That's how I do it myself. – Helgi May 28 '12 at 14:28
  • yeah, i have seen that blog post... but I wanted to make it a bit more user-friendly... avoid the server provisioning head-ache for the developers! – Jim Jose May 28 '12 at 17:19
  • There is no way to avoid the one-time setup. – Aaron Digulla May 28 '12 at 20:17
  • one-time setup is fine if there is a web GUI for it... in some cases its may be even third-party developers and I don't want them to ssh to my server (just for a 'hg update') – Jim Jose May 28 '12 at 20:39

2 Answers2

2

This is more simple than you'd think:

  1. Clone the website on your server using bitbucket as the source

  2. Write a small web app which calls hg pull -u in the root folder of your website. Mercurial remembers where to pull from, so you won't need anything here.

The second feature can be implemented using hg id -i (see this answer) to get the current revision. Write that to file.

Now you need a web page which lists all the revisions in that file and runs hg up -r <revision> when you click on one of them.

But maybe a better approach would be to push directly to the web server using hg push from your local repo (see here). You can then use a hook to update the files and save the last revision to a file.

Now you'll only need a web service to revert to a former revision.

Community
  • 1
  • 1
Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
  • "Write a small web app which calls hg pull -u" > thats exactly what i am looking for... some small webapp implementation which lists the available revisions and let me update to one. I am thinking about writing one with python/fabric.. but wanted to see if there is any tried & tested solutions out there... – Jim Jose May 28 '12 at 17:04
  • 3
    If you put the repository in your website root, be sure to configure your web server to deny access to the `.hg` directory, or your entire site source code and history will be exposed to the public! – Laurens Holst May 29 '12 at 11:19
0

Team City is a web app which can do that for you.

It is a continuous integration server but can be configured to only publish when you use the application.

There are many continuous integration servers and I imagine that most/all can do what you want so search around if that one doesn't quite fit your needs.

Steve Kaye
  • 6,262
  • 2
  • 23
  • 27