call (from github) to api\Repositories\webhook\github
call (from authenticated client) to api\Commits\{id}\build
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:
Find belongTo commit
Find belongTo repository
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.
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
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
Context
Two conditions for the creation of a
Job
:api\Repositories\webhook\github
api\Commits\{id}\build
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 forJob
, with node API (not exposed to REST), that does the following:belongTo
commitbelongTo
repositorygit
adress and commitsha
the yaml file and extracts a configuration list. Instead, act as if there was a single config in the list.Tests