screwdriver-data-schema 22.9.3 → 22.9.4
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/template.js +7 -0
- package/package.json +1 -1
- package/plugins/executor.js +17 -3
package/config/template.js
CHANGED
|
@@ -21,6 +21,12 @@ const TEMPLATE_NAME = Joi.alternatives()
|
|
|
21
21
|
.description('Name of the Template')
|
|
22
22
|
.example('node/npm-install');
|
|
23
23
|
|
|
24
|
+
const TEMPLATE_FULL_NAME = Joi.string()
|
|
25
|
+
.regex(Regex.TEMPLATE_NAME_ALLOW_SLASH)
|
|
26
|
+
.max(64)
|
|
27
|
+
.description('Full name including namespace of the Template')
|
|
28
|
+
.example('node/npm-install');
|
|
29
|
+
|
|
24
30
|
const TEMPLATE_TAG_NAME = Joi.string()
|
|
25
31
|
.regex(Regex.TEMPLATE_TAG_NAME)
|
|
26
32
|
.max(30)
|
|
@@ -75,6 +81,7 @@ module.exports = {
|
|
|
75
81
|
template: SCHEMA_TEMPLATE,
|
|
76
82
|
namespace: TEMPLATE_NAMESPACE,
|
|
77
83
|
name: TEMPLATE_NAME,
|
|
84
|
+
fullName: TEMPLATE_FULL_NAME,
|
|
78
85
|
templateTag: TEMPLATE_TAG_NAME,
|
|
79
86
|
version: TEMPLATE_VERSION,
|
|
80
87
|
exactVersion: TEMPLATE_EXACT_VERSION,
|
package/package.json
CHANGED
package/plugins/executor.js
CHANGED
|
@@ -4,6 +4,7 @@ const Joi = require('joi');
|
|
|
4
4
|
const Annotations = require('../config/annotations');
|
|
5
5
|
const Job = require('../config/job');
|
|
6
6
|
const Provider = require('../config/provider');
|
|
7
|
+
const Template = require('../config/template');
|
|
7
8
|
const models = require('../models');
|
|
8
9
|
const buildId = models.build.base.extract('id').required();
|
|
9
10
|
const eventId = models.event.base.extract('id');
|
|
@@ -12,14 +13,25 @@ const jobId = models.job.base.extract('id');
|
|
|
12
13
|
const jobName = models.job.base.extract('name');
|
|
13
14
|
const jobState = models.job.base.extract('state');
|
|
14
15
|
const jobArchived = models.job.base.extract('archived');
|
|
16
|
+
const pipelineId = models.pipeline.base.extract('id');
|
|
15
17
|
|
|
16
18
|
const SCHEMA_PIPELINE = Joi.object()
|
|
17
19
|
.keys({
|
|
18
|
-
id:
|
|
19
|
-
|
|
20
|
+
id: pipelineId.required(),
|
|
21
|
+
name: models.pipeline.base.extract('name').optional(),
|
|
22
|
+
scmContext: models.pipeline.base.extract('scmContext').required(),
|
|
23
|
+
configPipelineId: models.pipeline.base.extract('configPipelineId').required()
|
|
24
|
+
})
|
|
25
|
+
.unknown();
|
|
26
|
+
const SCHEMA_TEMPLATE = Joi.object()
|
|
27
|
+
.keys({
|
|
28
|
+
id: models.template.base.extract('id'),
|
|
29
|
+
fullName: Template.fullName,
|
|
30
|
+
name: models.template.base.extract('name'),
|
|
31
|
+
namespace: models.template.base.extract('namespace'),
|
|
32
|
+
version: models.template.base.extract('version')
|
|
20
33
|
})
|
|
21
34
|
.unknown();
|
|
22
|
-
const pipelineId = models.pipeline.base.extract('id');
|
|
23
35
|
const buildSchemaObj = {
|
|
24
36
|
build: Joi.object(),
|
|
25
37
|
causeMessage,
|
|
@@ -36,12 +48,14 @@ const buildSchemaObj = {
|
|
|
36
48
|
tokenGen: Joi.func(),
|
|
37
49
|
pipeline: SCHEMA_PIPELINE,
|
|
38
50
|
pipelineId,
|
|
51
|
+
template: SCHEMA_TEMPLATE,
|
|
39
52
|
buildClusterName: models.buildCluster.base.extract('name'),
|
|
40
53
|
container: models.build.base.extract('container').required(),
|
|
41
54
|
apiUri: Joi.string().uri().required().label('API URI'),
|
|
42
55
|
token: Joi.string().required().label('Build JWT'),
|
|
43
56
|
enqueueTime: Joi.date().iso(),
|
|
44
57
|
isPR: Joi.boolean().optional().default(true),
|
|
58
|
+
prNum: models.event.base.extract('prNum'),
|
|
45
59
|
prParentJobId: jobId.optional()
|
|
46
60
|
};
|
|
47
61
|
const SCHEMA_START = Joi.object()
|