screwdriver-data-schema 21.13.0 → 21.16.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/config/settings.js
CHANGED
|
@@ -29,7 +29,8 @@ const SCHEMA_PIPELINE_SETTINGS = Joi.object()
|
|
|
29
29
|
metricsDowntimeJobs: SCHEMA_METRICS_DOWNTIME_JOBS,
|
|
30
30
|
metricsDowntimeStatuses: SCHEMA_METRICS_DOWNTIME_STATUSES,
|
|
31
31
|
public: Joi.boolean(),
|
|
32
|
-
groupedEvents: Joi.boolean().default(false)
|
|
32
|
+
groupedEvents: Joi.boolean().default(false),
|
|
33
|
+
showEventTriggers: Joi.boolean().default(false)
|
|
33
34
|
})
|
|
34
35
|
.default({});
|
|
35
36
|
|
package/config/template.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
const Joi = require('joi');
|
|
4
4
|
const Job = require('./job');
|
|
5
5
|
const Regex = require('./regex');
|
|
6
|
+
const Parameters = require('./parameters');
|
|
6
7
|
|
|
7
8
|
const TEMPLATE_NAMESPACE = Joi.string()
|
|
8
9
|
.regex(Regex.TEMPLATE_NAMESPACE)
|
|
@@ -61,6 +62,8 @@ const TEMPLATE_IMAGES = Joi.object()
|
|
|
61
62
|
})
|
|
62
63
|
.min(1);
|
|
63
64
|
|
|
65
|
+
const SCHEMA_JOB_PARAMETERS = Parameters.parameters.optional();
|
|
66
|
+
|
|
64
67
|
const SCHEMA_TEMPLATE = Joi.object().keys({
|
|
65
68
|
namespace: TEMPLATE_NAMESPACE,
|
|
66
69
|
name: TEMPLATE_NAME.required(),
|
|
@@ -71,7 +74,8 @@ const SCHEMA_TEMPLATE = Joi.object().keys({
|
|
|
71
74
|
.required()
|
|
72
75
|
.or('image', 'template')
|
|
73
76
|
.or('steps', 'template'),
|
|
74
|
-
images: TEMPLATE_IMAGES
|
|
77
|
+
images: TEMPLATE_IMAGES,
|
|
78
|
+
parameters: SCHEMA_JOB_PARAMETERS
|
|
75
79
|
});
|
|
76
80
|
|
|
77
81
|
/**
|
|
@@ -89,5 +93,6 @@ module.exports = {
|
|
|
89
93
|
maintainer: TEMPLATE_MAINTAINER,
|
|
90
94
|
config: Job.templateJob,
|
|
91
95
|
configNoDupSteps: Job.jobNoDupSteps,
|
|
92
|
-
images: TEMPLATE_IMAGES
|
|
96
|
+
images: TEMPLATE_IMAGES,
|
|
97
|
+
parameters: SCHEMA_JOB_PARAMETERS
|
|
93
98
|
};
|
package/core/scm.js
CHANGED
|
@@ -251,7 +251,22 @@ const SCHEMA_HOOK = Joi.object()
|
|
|
251
251
|
releaseAuthor: Joi.string()
|
|
252
252
|
.allow('')
|
|
253
253
|
.optional()
|
|
254
|
-
.label('Author of the event')
|
|
254
|
+
.label('Author of the event'),
|
|
255
|
+
|
|
256
|
+
addedFiles: Joi.array()
|
|
257
|
+
.items(Joi.string().allow(''))
|
|
258
|
+
.optional()
|
|
259
|
+
.label('Added files of head commit'),
|
|
260
|
+
|
|
261
|
+
modifiedFiles: Joi.array()
|
|
262
|
+
.items(Joi.string().allow(''))
|
|
263
|
+
.optional()
|
|
264
|
+
.label('Modified files of head commit'),
|
|
265
|
+
|
|
266
|
+
removedFiles: Joi.array()
|
|
267
|
+
.items(Joi.string().allow(''))
|
|
268
|
+
.optional()
|
|
269
|
+
.label('Removed files of head commit')
|
|
255
270
|
})
|
|
256
271
|
.label('SCM Hook');
|
|
257
272
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* eslint-disable new-cap */
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
const prefix = process.env.DATASTORE_SEQUELIZE_PREFIX || '';
|
|
6
|
+
const table = `${prefix}templates`;
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
up: async (queryInterface, Sequelize) => {
|
|
10
|
+
await queryInterface.sequelize.transaction(async transaction => {
|
|
11
|
+
await queryInterface.addColumn(
|
|
12
|
+
table,
|
|
13
|
+
'parameters',
|
|
14
|
+
{
|
|
15
|
+
type: Sequelize.TEXT('medium')
|
|
16
|
+
},
|
|
17
|
+
{ transaction }
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
};
|
package/models/template.js
CHANGED
|
@@ -32,7 +32,8 @@ const MODEL = {
|
|
|
32
32
|
.description('When this template was created')
|
|
33
33
|
.example('2038-01-19T03:14:08.131Z'),
|
|
34
34
|
trusted: Joi.boolean().description('Mark whether template is trusted'),
|
|
35
|
-
latest: Joi.boolean().description('Whether this is latest version')
|
|
35
|
+
latest: Joi.boolean().description('Whether this is latest version'),
|
|
36
|
+
parameters: Template.parameters
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
const CREATE_MODEL = { ...MODEL, config: Template.configNoDupSteps };
|
|
@@ -64,7 +65,7 @@ module.exports = {
|
|
|
64
65
|
mutate(
|
|
65
66
|
MODEL,
|
|
66
67
|
['id', 'labels', 'name', 'version', 'description', 'maintainer', 'pipelineId'],
|
|
67
|
-
['config', 'namespace', 'images', 'createTime', 'trusted', 'latest']
|
|
68
|
+
['config', 'namespace', 'images', 'createTime', 'trusted', 'latest', 'parameters']
|
|
68
69
|
)
|
|
69
70
|
).label('Get Template'),
|
|
70
71
|
|
|
@@ -78,7 +79,7 @@ module.exports = {
|
|
|
78
79
|
mutate(
|
|
79
80
|
CREATE_MODEL,
|
|
80
81
|
['config', 'name', 'version', 'description', 'maintainer'],
|
|
81
|
-
['labels', 'namespace', 'images']
|
|
82
|
+
['labels', 'namespace', 'images', 'parameters']
|
|
82
83
|
)
|
|
83
84
|
).label('Create Template'),
|
|
84
85
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "screwdriver-data-schema",
|
|
3
|
-
"version": "21.
|
|
3
|
+
"version": "21.16.1",
|
|
4
4
|
"description": "Internal Data Schema of Screwdriver",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"mysql2": "^1.7.0",
|
|
50
50
|
"nyc": "^15.0.0",
|
|
51
51
|
"pg": "^7.18.2",
|
|
52
|
-
"sequelize": "^5.22.
|
|
52
|
+
"sequelize": "^5.22.5",
|
|
53
53
|
"sequelize-cli": "^5.5.1",
|
|
54
|
-
"sqlite3": "^
|
|
54
|
+
"sqlite3": "^5.0.0"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"cron-parser": "^2.
|
|
58
|
-
"joi": "^17.
|
|
57
|
+
"cron-parser": "^4.2.1",
|
|
58
|
+
"joi": "^17.5.0"
|
|
59
59
|
}
|
|
60
60
|
}
|