screwdriver-data-schema 23.5.1 → 23.6.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/job.js +3 -1
- package/config/regex.js +7 -5
- package/package.json +1 -1
package/config/job.js
CHANGED
|
@@ -139,12 +139,14 @@ const SCHEMA_TRIGGER = sdJoi.string().branchFilter();
|
|
|
139
139
|
const SCHEMA_INTERNAL_TRIGGER = Joi.string().regex(Regex.INTERNAL_TRIGGER); // ~main, ~jobOne
|
|
140
140
|
const SCHEMA_EXTERNAL_TRIGGER = Joi.string().regex(Regex.EXTERNAL_TRIGGER_ALL).example('~sd@1234:component'); // ~sd@123:main or sd@123:main
|
|
141
141
|
const SCHEMA_STAGE_TRIGGER = Joi.string().regex(Regex.STAGE_TRIGGER); // ~stage@deploy, ~stage@deploy:main
|
|
142
|
+
const SCHEMA_EXTERNAL_STAGE_TRIGGER = Joi.string().regex(Regex.EXTERNAL_STAGE_TRIGGER); // ~sd@26:stage@alpha:setup, sd@26:stage@alpha:deploy
|
|
142
143
|
const SCHEMA_CRON_EXPRESSION = sdCron.string().cron();
|
|
143
144
|
const SCHEMA_REQUIRES_VALUE = Joi.alternatives().try(
|
|
144
145
|
SCHEMA_INTERNAL_TRIGGER,
|
|
145
146
|
SCHEMA_JOBNAME,
|
|
146
147
|
SCHEMA_TRIGGER,
|
|
147
|
-
SCHEMA_STAGE_TRIGGER
|
|
148
|
+
SCHEMA_STAGE_TRIGGER,
|
|
149
|
+
SCHEMA_EXTERNAL_STAGE_TRIGGER
|
|
148
150
|
);
|
|
149
151
|
const SCHEMA_REQUIRES = Joi.alternatives().try(Joi.array().items(SCHEMA_REQUIRES_VALUE), SCHEMA_REQUIRES_VALUE);
|
|
150
152
|
const SCHEMA_BLOCKEDBY_VALUE = Joi.alternatives().try(
|
package/config/regex.js
CHANGED
|
@@ -55,15 +55,17 @@ module.exports = {
|
|
|
55
55
|
QUALIFIED_STAGE_NAME: /^stage@([\w-]+)$/,
|
|
56
56
|
// Stage trigger like ~stage@deploy or ~stage@stageName:jobName or stage@deploy or stage@stageName:jobName
|
|
57
57
|
STAGE_TRIGGER: /^~?stage@([\w-]+)(?::([\w-]+))?$/,
|
|
58
|
+
// External Stage trigger like ~sd@26:stage@alpha:setup
|
|
59
|
+
EXTERNAL_STAGE_TRIGGER: /^~?sd@\d+:(?:([\w-]+)|(stage@([\w-]+):(setup|teardown)))$/,
|
|
58
60
|
// Don't combine EXTERNAL_TRIGGER and EXTERNAL_TRIGGER_AND for backward compatibility
|
|
59
61
|
// BlockBy does not support EXTERNAL_TRIGGER_AND
|
|
60
|
-
// External trigger like ~sd@123:component (OR case)
|
|
61
|
-
EXTERNAL_TRIGGER: /^~sd@(\d+):([\w-]+)$/,
|
|
62
|
-
// External trigger like sd@123:component (AND case)
|
|
63
|
-
EXTERNAL_TRIGGER_AND: /^sd@(\d+):([\w-]+)$/,
|
|
62
|
+
// External trigger like ~sd@123:component, ~sd@26:stage@alpha:setup (OR case)
|
|
63
|
+
EXTERNAL_TRIGGER: /^~sd@(\d+):(?:([\w-]+)|(stage@([\w-]+):setup))$/,
|
|
64
|
+
// External trigger like sd@123:component, sd@26:stage@alpha:setup (AND case)
|
|
65
|
+
EXTERNAL_TRIGGER_AND: /^sd@(\d+):(?:([\w-]+)|(stage@([\w-]+):setup))$/,
|
|
64
66
|
// External trigger (OR and AND case)
|
|
65
67
|
// Can be ~sd@123:component or sd@123:component
|
|
66
|
-
EXTERNAL_TRIGGER_ALL: /^~?sd@(\d+):([\w-]+)$/,
|
|
68
|
+
EXTERNAL_TRIGGER_ALL: /^~?sd@(\d+):(?:([\w-]+)|(stage@([\w-]+):setup))$/,
|
|
67
69
|
|
|
68
70
|
// Can be ~pr, ~commit, ~release, ~tag or ~commit:branchName, or ~sd@123:component
|
|
69
71
|
// Note: if you modify this regex, you must modify `sdJoi` definition in the `config/job.js`
|