Why we need a post release/deployment web hook, and how awesome it will be for beanstalk :)

Joel Gascoigne's Avatar

Joel Gascoigne

03 Feb, 2010 12:40 AM via web

Hi guys,

I absolutely love beanstalk, let me just say that first :) I switched over from Springloops a while back and I've been very happy with the service. I'm the technical co-founder of an early stage startup called OnePage, and we're moving pretty fast - beanstalk makes it even easier for us to move fast, taking the hassle out of our version control and deployments.

As a startup following the lean startup concepts as promoted by Eric Ries, one of the core disciplines I'm attempting to engrain into the culture of OnePage is that of a very tight feedback loop with our users/customers. This involves agile software development practices (including test-driven-development, or some practice to enable self-testing code) combined with Steve Blank's customer development. What this means for us, is making that feedback loop as quick as possible. One of the enablers of this is called Continuous Deployment, which is a practice where your unit and integration tests are run after each commit, at which point if they all pass then the code is deployed to production. Once it is there, metrics are measured over the course of minutes or hours and anything which falls above or below thresholds causes an alert and the previous version is rolled back.

I mentioned that a post-deployment hook is what is necessary in order to achieve this with beanstalk a number of months ago, and I have seen it mentioned in a number of threads, even one which said you are looking to make this available before 2010 - http://help.beanstalkapp.com/discussions/suggestions/57-additional-...

I'm very eager for beanstalk to enable this and avoid a lot of the hassle that is incurred when getting into the realm of continuous integration servers. Here's the way I see it working:

  1. Work locally
  2. Commit to beanstalk
  3. Beanstalk automatically deploys to development server
  4. Post deployment hook on development server triggersa script to run the test suite on development server
  5. If the tests pass, use the beanstalk API to push a release to the production server

Please let us know where you are with this, or if there is a way you could see that this could be achieved already. I will definitely enjoy writing a blog post about this once we get the process working well.

Joel
http://myonepage.com/joel

  1. Support Staff 2 Posted by Chris Nagele on 03 Feb, 2010 02:27 AM

    Chris Nagele's Avatar

    Hi Joel,

    We got a bit distracted by Git support at the end of the year. I will make sure a developer works on this in the next few weeks.

    Thanks,
    Chris

  2. 3 Posted by Joel Gascoigne on 03 Feb, 2010 11:23 AM

    Joel Gascoigne's Avatar

    Thanks Chris, I'm really looking forward to this feature! :)

  3. 4 Posted by Petyo Ivanov on 03 Feb, 2010 01:51 PM

    Petyo Ivanov's Avatar

    Hi Joel,

    First of all, I want to suggest two alternatives available currently, and figure out if (or why don't) they work for you.

    First option is to use our current web hooks, and have a script that does the checkout, runs the tests, then pushes deployment if successful.

    Second option is to use some resident script that watches over the .revision file we deploy. Something like that (in ruby, probably trivial to be done in another language):

    http://pastie.org/807486

    Please let me know what you think,
    Petyo

  4. 5 Posted by Joel Gascoigne on 06 Feb, 2010 02:19 PM

    Joel Gascoigne's Avatar

    Hi Petyo,

    Thanks for the suggestions :)

    The first option I'm not too keen on since it will involve me writing a script to check out the recently committed version, which I sense would turn out to be less straightforward than I'd like to get into. It's kinda why I'm paying you guys ;)

    The second option could actually work quite nicely! The only issue is that I'm on a MediaTemple (gs) (for the moment) and they don't allow resident scripts. They do, however, allow 5 cron jobs but the highest frequency I can call is every 15 minutes. I will give that a go for now (check every 15 minutes to see if a new release has been deployed, then do as I wanted to), but it isn't really the best solution for the long term. I'll get back to you if I have any problems with this approach, or if indeed it works well!

    Thanks :)

  5. 6 Posted by Joel Gascoigne on 06 Feb, 2010 04:28 PM

    Joel Gascoigne's Avatar

    Whilst I remember, let me give you another reason why the post-release hook would be fantastic for me and most likely others:

    I have a script which will scan all CSS and JavaScript folders and combine and minify all the CSS and then all the Javascript if there have been any modifications since the last time the script was run. It does this by generating an md5 hash for the single CSS and single JS file based on the modified dates of all the individual files. If there have been modifications, it will then generate a single CSS and single JS file and upload it to Amazon S3 where it is then served for our users via CloudFront, which is a Content Delivery Network (CDN). This has numerous performance benefits.

    Currently, I have to manually run this script once I have seen that the deployment has completed. This would be much better if it was automatically called using the post-release web hook, which I trust is coming soon ;)

    Again, I'd love to write a blog post on this and the previous use for these web hooks.

    Thanks guys, keep up the good work.

  6. 7 Posted by Petyo Ivanov on 08 Feb, 2010 09:32 AM

    Petyo Ivanov's Avatar

    Thanks for the thorough explanations Joel. I agree that taking care of resident scripts/daemons can be a pain in the ass.

    We are currently in the progress of improving releases, so I will do my best to include these hooks in the current iteration, which should be out in a week or two. Will keep you posted.

    Petyo

  7. 8 Posted by Joel Gascoigne on 08 Feb, 2010 10:00 AM

    Joel Gascoigne's Avatar

    Thanks Petyo! I'm really looking forward to making use of this functionality :)

  8. 9 Posted by Petyo Ivanov on 18 Feb, 2010 10:48 PM

    Petyo Ivanov's Avatar

    Hi,

    I am pleased to announce that we released post-commit web hooks in today's release.
    Please give it a try and let us know how it goes.

    Thanks,
    Petyo

  9. Petyo Ivanov resolved this discussion on 18 Feb, 2010 10:48 PM.

  10. Joel Gascoigne re-opened this discussion on 18 Feb, 2010 11:09 PM

  11. 10 Posted by Joel Gascoigne on 18 Feb, 2010 11:09 PM

    Joel Gascoigne's Avatar

    I noticed earlier, I'll be trying it out over the next few days and I'll let you know how it goes :)

    Thank you!!

  12. Petyo Ivanov resolved this discussion on 23 Feb, 2010 04:27 PM.

Comments are currently closed for this discussion. You can start a new one.