Make smart recreate the default
Add --force-recreate flag to enable the old default behaviour of recreating everything. Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
parent
b2cb5a48d2
commit
ced94a3504
8 changed files with 77 additions and 53 deletions
|
|
@ -197,7 +197,7 @@ class ProjectTest(DockerClientTestCase):
|
|||
self.assertEqual(len(db.containers()), 1)
|
||||
self.assertEqual(len(web.containers()), 1)
|
||||
|
||||
def test_project_up_recreates_containers(self):
|
||||
def test_recreate_preserves_volumes(self):
|
||||
web = self.create_service('web')
|
||||
db = self.create_service('db', volumes=['/etc'])
|
||||
project = Project('composetest', [web, db], self.client)
|
||||
|
|
@ -209,7 +209,7 @@ class ProjectTest(DockerClientTestCase):
|
|||
old_db_id = project.containers()[0].id
|
||||
db_volume_path = project.containers()[0].get('Volumes./etc')
|
||||
|
||||
project.up()
|
||||
project.up(force_recreate=True)
|
||||
self.assertEqual(len(project.containers()), 2)
|
||||
|
||||
db_container = [c for c in project.containers() if 'db' in c.name][0]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue