screwdriver-data-schema 22.8.0 → 22.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/models/pipeline.js +20 -5
- package/package.json +1 -1
package/models/pipeline.js
CHANGED
|
@@ -11,6 +11,13 @@ const Parameters = require('../config/parameters');
|
|
|
11
11
|
const mutate = require('../lib/mutate');
|
|
12
12
|
|
|
13
13
|
const STATES = ['ACTIVE', 'INACTIVE'];
|
|
14
|
+
const BADGE = Joi.object({
|
|
15
|
+
name: Joi.string().max(128).description('The dashboard name for a badge').example('screwdriver/ui'),
|
|
16
|
+
uri: Joi.string()
|
|
17
|
+
.max(500)
|
|
18
|
+
.description('Unique identifier for the badge application dashboard')
|
|
19
|
+
.example('https://sonar.screwdriver.cd/dashboard?id=112233')
|
|
20
|
+
});
|
|
14
21
|
|
|
15
22
|
const CREATE_MODEL = {
|
|
16
23
|
checkoutUrl: Joi.string()
|
|
@@ -90,7 +97,14 @@ const MODEL = {
|
|
|
90
97
|
actions: Joi.array().items(Joi.string())
|
|
91
98
|
})
|
|
92
99
|
)
|
|
93
|
-
.description('List of subscribed scm urls paired with actions')
|
|
100
|
+
.description('List of subscribed scm urls paired with actions'),
|
|
101
|
+
|
|
102
|
+
badges: Joi.object({
|
|
103
|
+
sonar: BADGE
|
|
104
|
+
})
|
|
105
|
+
.description('A list of badges that pipline has')
|
|
106
|
+
.example(`{ sonar: { name: 'dashboard', uri: 'http://sonar.com/sample1' } }`)
|
|
107
|
+
.optional()
|
|
94
108
|
};
|
|
95
109
|
|
|
96
110
|
const UPDATE_MODEL = { ...CREATE_MODEL, settings: MODEL.settings };
|
|
@@ -133,7 +147,8 @@ module.exports = {
|
|
|
133
147
|
'prChain',
|
|
134
148
|
'parameters',
|
|
135
149
|
'subscribedScmUrlsWithActions',
|
|
136
|
-
'settings'
|
|
150
|
+
'settings',
|
|
151
|
+
'badges'
|
|
137
152
|
]
|
|
138
153
|
)
|
|
139
154
|
).label('Get Pipeline'),
|
|
@@ -154,9 +169,9 @@ module.exports = {
|
|
|
154
169
|
* @property update
|
|
155
170
|
* @type {Joi}
|
|
156
171
|
*/
|
|
157
|
-
update: Joi.object(
|
|
158
|
-
'
|
|
159
|
-
),
|
|
172
|
+
update: Joi.object(
|
|
173
|
+
mutate(UPDATE_MODEL, [], ['checkoutUrl', 'rootDir', 'autoKeysGeneration', 'settings', 'badges'])
|
|
174
|
+
).label('Update Pipeline'),
|
|
160
175
|
|
|
161
176
|
/**
|
|
162
177
|
* List of fields that determine a unique row
|