Overdrivr / micro-ci

Continuous Integration for embedded platforms
0 stars 0 forks source link

Job creation logic #55

Closed Overdrivr closed 8 years ago

Overdrivr commented 8 years ago

Context

Two conditions for the creation of a Job:

Both call will trigger the creation of a job, which in return will create one or more build(s) depending on the repository configuration.

Proposal

Modify the create method or implement a custom method for Job, with node API (not exposed to REST), that does the following:

  1. Find belongTo commit
  2. Find belongTo repository
  3. For now, fake the library (that must be written in the future) that grabs from repository git adress and commit sha the yaml file and extracts a configuration list. Instead, act as if there was a single config in the list.
  4. Create a build for each config list entry

    Tests

    • Test @ node API level with default config that a single job and a single build is created
    • Test @ node API level with mocked config that generates 3 builds that a single job is created and three builds are instanciated
    • Test @ REST API level that a call to webhook endpoint creates a job
    • Test @ REST API level that a call to manual build enpoint creates a job
DanFaudemer commented 8 years ago

Summary: In the model repository.js create the JOB linked to a commit and a repository. @Overdrivr
In job.js after save hook create a build linked to this job. -> Dan