Skip to content

Commit 96ab73a

Browse files
author
Oleg Sucharevich
authored
allow to pass skip-validation of a trigger (#278)
1 parent 2ac05bf commit 96ab73a

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

lib/interface/cli/commands/root/replace.cmd.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ const annotate = new Command({
1818
},
1919
builder: (yargs) => {
2020
crudFilenameOption(yargs);
21+
yargs.option('skip-trigger-validation', {
22+
describe: 'Set to true to skip validation (for pipeline replace)',
23+
type: 'boolean',
24+
default: false,
25+
});
2126
return yargs;
2227
},
2328
handler: async (argv) => {
@@ -44,7 +49,7 @@ const annotate = new Command({
4449
console.warn(result.message);
4550
return;
4651
}
47-
await pipeline.replaceByName(name, data);
52+
await pipeline.replaceByName(name, data, argv.skipTriggerValidation);
4853
console.log(`Pipeline '${name}' updated`);
4954
break;
5055
default:

lib/logic/api/pipeline.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,17 @@ const validateYaml = async (yaml) => {
7575
return sendHttpRequest(optionsValidate);
7676
};
7777

78-
const replaceByName = async (name, data) => {
78+
const replaceByName = async (name, data, skipTriggerValidation = false) => {
7979
const body = data;
8080

8181
const options = {
8282
url: `/api/pipelines/${encodeURIComponent(name)}`,
8383
method: 'PUT',
8484
body,
8585
};
86-
86+
if (skipTriggerValidation) {
87+
options.qs = { skipTriggerValidation };
88+
}
8789
return sendHttpRequest(options);
8890
};
8991

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codefresh",
3-
"version": "0.11.2",
3+
"version": "0.12.0",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,

0 commit comments

Comments
 (0)