コード例 #1
0
ファイル: job.go プロジェクト: icsnju/apt-mesos
func (core *Core) StartJob(job *registry.Job) error {
	log.Infof("Starting job: %v", job.ID)
	if job.Image == "" && job.ContextDir == "" {
		return errors.New("Start job error: image, context_dir cannot be nil at the same time")
	}

	job.StartTime = time.Now().UnixNano()
	if job.ContextDir != "" {
		core.BuildImage(job)
	}

	// TODO split input
	job.Status = registry.StatusRunning
	core.RunTask(job)

	return nil
}