Class: Job

Inherits:
ApplicationRecord show all
Defined in:
app/models/job.rb

Overview

Job Spec: {

sections: [
  { name: "name", on_success: [], on_failure: [], commands: [], fail_on_err: true }
],
services: [
  { name: "", docker: { ... } }
],
repo: {
  name: "repo",
  owner: "repo-owner",
  commit: "abcdefg",
  branch: "feature/x",
  provider: "github.com",
}

}

Class Method Summary collapse

Class Method Details

.popObject



23
24
25
# File 'app/models/job.rb', line 23

def self.pop
  Job.where(status: 'PENDING').limit(1).update(worker: worker).first
end