screwdriver-config-parser
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -21,2 +21,3 @@ 'use strict'; | ||
// Replace | ||
['image', 'matrix', 'steps'].forEach((key) => { | ||
@@ -31,4 +32,9 @@ if (oldJob[key]) { | ||
} | ||
if (!newJob.secrets) { | ||
newJob.secrets = []; | ||
} | ||
// Merge | ||
Object.assign(newJob.environment, oldJob.environment || {}); | ||
newJob.secrets = newJob.secrets.concat(oldJob.secrets || []); | ||
@@ -35,0 +41,0 @@ newJobs[jobName] = newJob; |
@@ -80,3 +80,3 @@ 'use strict'; | ||
steps.forEach((step) => { | ||
if (step.name.indexOf('sd-') === 0) { | ||
if (step.name.toLowerCase().indexOf('sd-') === 0) { | ||
errors.push(`${prefix}: Step "${step.name}": ` | ||
@@ -130,2 +130,7 @@ + 'cannot use a restricted prefix "sd-"'); | ||
// Check special prefixes | ||
if (jobName.toLowerCase().indexOf('pr-') === 0) { | ||
errors.push(`${prefix}: cannot use a restricted prefix "pr-"`); | ||
} | ||
errors = errors.concat(validateJobMatrix(doc.jobs[jobName], prefix)); | ||
@@ -132,0 +137,0 @@ errors = errors.concat(validateJobSteps(doc.jobs[jobName], prefix)); |
@@ -23,2 +23,3 @@ 'use strict'; | ||
commands: Hoek.reach(doc, `jobs.${jobName}.commands`), | ||
secrets: Hoek.reach(doc, `jobs.${jobName}.secrets`), | ||
environment: Hoek.reach(doc, `jobs.${jobName}.environment`, { | ||
@@ -25,0 +26,0 @@ default: {} |
{ | ||
"name": "screwdriver-config-parser", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "Node module for parsing screwdriver.yaml configurations", | ||
@@ -50,5 +50,5 @@ "main": "index.js", | ||
"keymbinatorial": "^1.0.0", | ||
"screwdriver-data-schema": "^9.0.0", | ||
"screwdriver-data-schema": "^10.3.0", | ||
"tinytim": "^0.1.1" | ||
} | ||
} |
@@ -41,2 +41,5 @@ # Screwdriver.yaml Configuration Parser | ||
- tag: git push origin --tags | ||
secrets: | ||
- NPM_TOKEN | ||
- GIT_KEY | ||
``` | ||
@@ -43,0 +46,0 @@ |
@@ -24,3 +24,6 @@ { | ||
"DIRECTORY": "c" | ||
} | ||
}, | ||
"secrets": [ | ||
"GIT_KEY" | ||
] | ||
}, | ||
@@ -47,3 +50,6 @@ { | ||
"DIRECTORY": "d" | ||
} | ||
}, | ||
"secrets": [ | ||
"GIT_KEY" | ||
] | ||
} | ||
@@ -65,3 +71,7 @@ ], | ||
"DIRECTORY": "a" | ||
} | ||
}, | ||
"secrets": [ | ||
"GIT_KEY", | ||
"NPM_TOKEN" | ||
] | ||
}, | ||
@@ -81,3 +91,7 @@ { | ||
"DIRECTORY": "b" | ||
} | ||
}, | ||
"secrets": [ | ||
"GIT_KEY", | ||
"NPM_TOKEN" | ||
] | ||
}, | ||
@@ -97,3 +111,7 @@ { | ||
"DIRECTORY": "a" | ||
} | ||
}, | ||
"secrets": [ | ||
"GIT_KEY", | ||
"NPM_TOKEN" | ||
] | ||
}, | ||
@@ -113,3 +131,7 @@ { | ||
"DIRECTORY": "b" | ||
} | ||
}, | ||
"secrets": [ | ||
"GIT_KEY", | ||
"NPM_TOKEN" | ||
] | ||
} | ||
@@ -116,0 +138,0 @@ ] |
@@ -19,3 +19,4 @@ { | ||
"STRING": "test" | ||
} | ||
}, | ||
"secrets": [] | ||
} | ||
@@ -22,0 +23,0 @@ ] |
@@ -19,3 +19,4 @@ { | ||
"NODE_VERSION": "4" | ||
} | ||
}, | ||
"secrets": [] | ||
}, | ||
@@ -37,3 +38,4 @@ { | ||
"NODE_VERSION": "5" | ||
} | ||
}, | ||
"secrets": [] | ||
}, | ||
@@ -55,3 +57,4 @@ { | ||
"NODE_VERSION": "6" | ||
} | ||
}, | ||
"secrets": [] | ||
} | ||
@@ -79,3 +82,6 @@ ], | ||
"NODE_TAG": "latest" | ||
} | ||
}, | ||
"secrets": [ | ||
"NPM_TOKEN" | ||
] | ||
} | ||
@@ -82,0 +88,0 @@ ] |
@@ -156,2 +156,11 @@ 'use strict'; | ||
}); | ||
it('returns an error if using restricted job names', (done) => { | ||
parser(loadData('restricted-job-name.yaml'), (err) => { | ||
assert.isNotNull(err); | ||
assert.match(err.toString(), | ||
/Job "pr-15": cannot use a restricted prefix "pr-"/); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
@@ -158,0 +167,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40622
34
820
96
+ Addedscrewdriver-data-schema@10.4.1(transitive)
- Removedscrewdriver-data-schema@9.0.1(transitive)