public function rebuild(DNEnvironment $environment, $log) {
		$name = $environment->getFullName();
		$command = $this->getCommand('deploy:migrate', 'web', $environment, null, $log);
		$command->run(function($type, $buffer) use($log) {
			$log->write($buffer);
		});
		if(!$command->isSuccessful()) {
			$log->write(sprintf('Rebuild of "%s" failed: %s', $name, $command->getErrorOutput()));
			throw new RuntimeException($command->getErrorOutput());
		}
		$log->write(sprintf('Rebuild of "%s" done', $name));
	}