'Deploy a new release to this application'

def deploy(self, user, release):

    self._prune_containers()
    existing = self.container_set.exclude(type=u'run')
    new = []
    scale_types = set()
    for e in existing:
        n = e.clone(release)
        n.save()
        new.append(n)
        scale_types.add(e.type)
    if (new and (u'deploy' in dir(self._scheduler))):
        self._deploy_app(scale_types, release, existing)
    else:
        self._start_containers(new)
        if existing:
            self._destroy_containers(existing)
    if ((self.structure == {}) and (release.build is not None)):
        self._default_scale(user, release)
