chore: enable verification on Jenkins
This commit is contained in:
Родитель
d05b94681f
Коммит
47fe1cbe1e
|
@ -1,12 +1,19 @@
|
|||
const conditionTravis = require('@semantic-release/condition-travis');
|
||||
|
||||
module.exports = function (pluginConfig, config, cb) {
|
||||
const branch = config.env.TRAVIS_BRANCH;
|
||||
const distTag = config.options.branchTags[branch];
|
||||
let branch;
|
||||
let defaultVerifyConditions;
|
||||
|
||||
if (config.env.TRAVIS) {
|
||||
defaultVerifyConditions = require('@semantic-release/condition-travis');
|
||||
branch = config.env.TRAVIS_BRANCH;
|
||||
} else {
|
||||
defaultVerifyConditions = require('@krux/condition-jenkins');
|
||||
branch = config.env.GIT_BRANCH;
|
||||
}
|
||||
|
||||
// update semantic-release configuration to publish:
|
||||
// - from this branch
|
||||
// - with the specified dist tag
|
||||
const distTag = config.options.branchTags[branch];
|
||||
if (distTag) {
|
||||
console.log(`Enable prerelease on dist-tag '${distTag}'.`);
|
||||
|
||||
|
@ -14,6 +21,6 @@ module.exports = function (pluginConfig, config, cb) {
|
|||
config.npm.tag = distTag;
|
||||
}
|
||||
|
||||
// run default travis checks with the new configuration
|
||||
return conditionTravis(pluginConfig, config, cb);
|
||||
// run default build checks with the new configuration
|
||||
return defaultVerifyConditions(pluginConfig, config, cb);
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче