'Run a one-off command'

def run(self, command):

    if (self.release.build is None):
        raise EnvironmentError(u'No    build    associated    with    this    release    to    run    this    command')
    image = self.release.image
    entrypoint = u'/bin/bash'
    if (self.release.build.procfile and self.release.build.sha and (not self.release.build.dockerfile)):
        entrypoint = u'/runner/init'
        command = u"'{}'".format(command)
    else:
        command = u"-c    '{}'".format(command)
    try:
        (rc, output) = self._scheduler.run(self.job_id, image, entrypoint, command)
        return (rc, output)
    except Exception as e:
        err = u'{}    (run):    {}'.format(self.job_id, e)
        log_event(self.app, err, logging.ERROR)
        raise
