orchardup/fig — pull request #162 by sebastianneubauer (2014-03-23 13:34:23+00:00)
Title: scaling down now also survives a restart

As described in #121 there is (at least for me) an unexpected behaviour in the scaling feature.
If you restart the project (fig up) after you scale down it is once again scaled to the higher scaling number before the downscaling. But when you scale up, after a restart it is scaled to the last value.

This is because the downscaling just stops the containers and does not remove them. On the other hand, fig up starts all stopped containers.

This patch resolves this in a minimal way by just removing all stopped containers after scaling.

One could think of making the scaling more explicit, by persisting the scaling value and starting and stopping containers according to this scaling value.

In order to be able to test the behaviour, I extracted the fig up code into a member 'up' of the project class.