Add "fig build" command
This commit is contained in:
parent
853d8ad280
commit
a39db86651
3 changed files with 20 additions and 1 deletions
|
|
@ -137,7 +137,7 @@ class Service(object):
|
|||
if 'volumes' in container_options:
|
||||
container_options['volumes'] = dict((v.split(':')[1], {}) for v in container_options['volumes'])
|
||||
|
||||
if 'build' in self.options:
|
||||
if self.can_be_built():
|
||||
if len(self.client.images(name=self._build_tag_name())) == 0:
|
||||
self.build()
|
||||
container_options['image'] = self._build_tag_name()
|
||||
|
|
@ -167,6 +167,9 @@ class Service(object):
|
|||
|
||||
return image_id
|
||||
|
||||
def can_be_built(self):
|
||||
return 'build' in self.options
|
||||
|
||||
def _build_tag_name(self):
|
||||
"""
|
||||
The tag to give to images built for this service.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue