Skip to content

Commit

Permalink
Merge pull request #107 from screwdriver-cd/email
Browse files Browse the repository at this point in the history
feat: Add settings to job config
  • Loading branch information
minzcmu authored Feb 24, 2017
2 parents 505964a + c7677b4 commit abfb345
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 5 additions & 2 deletions config/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ const SCHEMA_STEP_OBJECT = Joi.object()
const SCHEMA_STEP = Joi.alternatives().try(SCHEMA_STEP_STRING, SCHEMA_STEP_OBJECT);
const SCHEMA_STEPS = Joi.array().items(SCHEMA_STEP).min(1);
const SCHEMA_IMAGE = Joi.string();
const SCHEMA_SETTINGS = Joi.object().optional();
const SCHEMA_JOB = Joi.object()
.keys({
steps: SCHEMA_STEPS,
environment: SCHEMA_ENVIRONMENT,
matrix: SCHEMA_MATRIX,
image: SCHEMA_IMAGE,
secrets: SCHEMA_SECRETS
secrets: SCHEMA_SECRETS,
settings: SCHEMA_SETTINGS
})
.default({});

Expand All @@ -82,5 +84,6 @@ module.exports = {
step: SCHEMA_STEP,
environment: SCHEMA_ENVIRONMENT,
image: SCHEMA_IMAGE,
job: SCHEMA_JOB
job: SCHEMA_JOB,
settings: SCHEMA_SETTINGS
};
6 changes: 6 additions & 0 deletions test/config/job.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,10 @@ describe('config job', () => {
assert.isNull(validate('config.job.image.yaml', config.job.image).error);
});
});

describe('settings', () => {
it('validates settings', () => {
assert.isNull(validate('config.job.settings.yaml', config.job.settings).error);
});
});
});
1 change: 1 addition & 0 deletions test/data/config.job.settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
foo: bar

0 comments on commit abfb345

Please sign in to comment.