About Archive Tags RSS Feed

 

So PaaS

6 December 2013 21:50

I just realised a lot of my projects are deployed in the same way:

  • They run under runit.
  • They operate directly from git clones.

This includes both Apache-based projects, and node.js projects.

I'm sure I could generalize this, and do clever things with git-hooks. Right now for example I have run-scripts which look like this:

#!/bin/sh
#
# /etc/service/blogspam.js/run - Runs the blogspam.net API.
#


# update the repository.
git pull --update --quiet

# install dependencies, if appropriate.
npm install

# launche
exec node server.js

It seems the only thing that differs is the name of the directory and the remote git clone URL.

With a bit of scripting magic I'm sure you could push applications to a virgin Debian installation and have it do the right thing.

I think the only obvious thing I'm missing is a list of Debian dependencies. Perhaps adding soemthing like the packages.json file I could add an extra step:

apt-get update -qq
apt-get install --yes --force-yes $(cat packages.apt)

Making deployments easy is a good thing, and consistency helps..

| 2 comments

 

Comments on this entry

icon Nux at 09:07 on 9 December 2013
http://www.nux.ro

Steve, have you looked at Docker yet? From what I read in your post it seems the kind of thing that would get you interested.

icon Steve at 17:55 on 9 December 2013
http://www.steve.org.uk/

I keep meaning to, but the idea of having a single host share lots of services makes me a little unhappy.

(i.e. You have to bind different deamons to different interfaces explicitly.)

I accept it is flexible, and sexy, and modern, but with my automation tools I'm as well to just spin up a "real" machine. It takes minutes, rather than seconds, but I need to make coffee sometime anyway ...