Skip to content

Commit a20798a

Browse files
Gabriel MonroyMatthew Fisher
authored andcommitted
feat(scheduler): add command handling for procfile-style execution
1 parent 51f5d6d commit a20798a

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

controller/api/models.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,19 @@ def _get_scheduler(self):
239239

240240
_scheduler = property(_get_scheduler)
241241

242+
def _get_command(self):
243+
c_type = self.type
244+
if c_type:
245+
return 'start {c_type}'
246+
else:
247+
return ''
248+
249+
_command = property(_get_command)
250+
242251
def create(self):
243252
image = self.release.build.image
244-
self._scheduler.create(self._job_id, image, 'docker run {image}'.format(**locals()))
253+
c_type = self.type
254+
self._scheduler.create(self._job_id, image, self._command.format(**locals()))
245255
self.state = 'created'
246256
self.save()
247257

0 commit comments

Comments
 (0)