screwdriver-data-schema 21.11.0 → 21.15.0
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
|
@@ -28,7 +28,9 @@ const SCHEMA_PIPELINE_SETTINGS = Joi.object()
|
|
|
28
28
|
.keys({
|
|
29
29
|
metricsDowntimeJobs: SCHEMA_METRICS_DOWNTIME_JOBS,
|
|
30
30
|
metricsDowntimeStatuses: SCHEMA_METRICS_DOWNTIME_STATUSES,
|
|
31
|
-
public: Joi.boolean()
|
|
31
|
+
public: Joi.boolean(),
|
|
32
|
+
groupedEvents: Joi.boolean().default(false),
|
|
33
|
+
showEventTriggers: Joi.boolean().default(false)
|
|
32
34
|
})
|
|
33
35
|
.default({});
|
|
34
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
|
};
|
|
@@ -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,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "screwdriver-data-schema",
|
|
3
|
-
"version": "21.
|
|
3
|
+
"version": "21.15.0",
|
|
4
4
|
"description": "Internal Data Schema of Screwdriver",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"pretest": "eslint .",
|
|
8
8
|
"test": "nyc --report-dir ./artifacts/coverage --reporter=lcov mocha --reporter mocha-multi-reporters --reporter-options configFile=./mocha.config.json --recursive --timeout 4000 --retries 1 --exit --allow-uncaught true --color true",
|
|
9
|
-
"semantic-release": "semantic-release"
|
|
9
|
+
"semantic-release": "./node_modules/.bin/semantic-release --debug"
|
|
10
10
|
},
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
|
-
"url": "git
|
|
13
|
+
"url": "git+https://github.com/screwdriver-cd/data-schema.git"
|
|
14
14
|
},
|
|
15
15
|
"homepage": "https://github.com/screwdriver-cd/data-schema",
|
|
16
16
|
"bugs": "https://github.com/screwdriver-cd/data-schema/issues",
|
|
@@ -33,6 +33,9 @@
|
|
|
33
33
|
"Tiffany Kyi <tiffanykyi@gmail.com>"
|
|
34
34
|
],
|
|
35
35
|
"release": {
|
|
36
|
+
"branches": [
|
|
37
|
+
"master"
|
|
38
|
+
],
|
|
36
39
|
"debug": false
|
|
37
40
|
},
|
|
38
41
|
"devDependencies": {
|