Skip to content

Commit

Permalink
Merge pull request #147 from screwdriver-cd/annotation_models
Browse files Browse the repository at this point in the history
fix(580): add pipeline annotations to models
  • Loading branch information
r3rastogi authored Jun 16, 2017
2 parents c1ed94a + f6ffa18 commit dede5da
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
12 changes: 8 additions & 4 deletions models/pipeline.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
'use strict';

const Annotations = require('../config/annotations');
const Joi = require('joi');
const mutate = require('../lib/mutate');
const Regex = require('../config/regex');
const Workflow = require('../config/workflow');
const Scm = require('../core/scm');
const Workflow = require('../config/workflow');
const mutate = require('../lib/mutate');

const CHECKOUT_URL = {
checkoutUrl: Joi
Expand Down Expand Up @@ -39,7 +40,10 @@ const MODEL = {
.example({ myself: true }),

workflow: Workflow.workflow
.description('Current workflow of the pipeline')
.description('Current workflow of the pipeline'),

annotations: Annotations.annotations
.description('Pipeline-level annotations')
};

module.exports = {
Expand All @@ -60,7 +64,7 @@ module.exports = {
get: Joi.object(mutate(MODEL, [
'id', 'scmUri', 'createTime', 'admins'
], [
'workflow', 'scmRepo'
'workflow', 'scmRepo', 'annotations'
])).label('Get Pipeline'),

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@
"js-yaml": "^3.6.1"
},
"dependencies": {
"joi": "^10.0.5"
"joi": "^10.6.0"
}
}
6 changes: 6 additions & 0 deletions test/data/pipeline.get.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ scmRepo:
name: screwdriver-cd/screwdriver
branch: master
url: https://github.com/screwdriver-cd/screwdriver/tree/master
annotations:
screwdriver.cd/executor.resource:
- XCODE8
- OSX-SIERRA
screwdriver.cd/notify.email: foo@example.com
beta.screwdriver.cd/auto_pr_builds: fork-only

0 comments on commit dede5da

Please sign in to comment.