Skip to content

Commit e3f8b0e

Browse files
authored
rename link/unlink to trigger create/delete (#169)
updated commands ~`codefresh link`~ `codefresh create trigger` ~`codefresh unlink`~ `codefresh delete trigger`
1 parent 02b91c7 commit e3f8b0e

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

lib/interface/cli/commands/trigger/link.cmd.js renamed to lib/interface/cli/commands/trigger/create.cmd.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
require('debug')('codefresh:cli:create:trigger');
22

33
const Command = require('../../Command');
4+
const createRoot = require('../root/create.cmd')
45
const { trigger } = require('../../../../logic').api;
56

67
const command = new Command({
7-
root: true,
8-
command: 'link <event-uri> <pipeline>',
8+
command: 'trigger <event-uri> <pipeline>',
9+
aliases: ['t'],
10+
parent: createRoot,
911
description: 'Create trigger: link pipeline to `trigger-event`',
1012
webDocs: {
1113
category: 'Triggers',
12-
title: 'Define Pipeline Trigger',
14+
title: 'Create Pipeline Trigger',
1315
weight: 5,
1416
},
1517
builder: (yargs) => {
@@ -22,7 +24,7 @@ const command = new Command({
2224
describe: 'pipeline to be triggered by the `trigger-event`',
2325
require: true,
2426
})
25-
.example('codefresh link registry:dockerhub:codefresh:fortune:push 5a439664af73ad0001f3ece0', 'Setup trigger by linking 5a43... pipeline to the DockerHub `codefresh/fortune` `push` event');
27+
.example('codefresh create trigger registry:dockerhub:codefresh:fortune:push 5a439664af73ad0001f3ece0', 'Create trigger by linking 5a43... pipeline to the DockerHub `codefresh/fortune` `push` event');
2628
},
2729
handler: async (argv) => {
2830
/* eslint-disable prefer-destructuring */

lib/interface/cli/commands/trigger/unlink.cmd.js renamed to lib/interface/cli/commands/trigger/delete.cmd.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
require('debug')('codefresh:cli:delete:trigger');
22

33
const Command = require('../../Command');
4+
const deleteRoot = require('../root/delete.cmd');
45
const { trigger } = require('../../../../logic').api;
56

67
const command = new Command({
7-
root: true,
8-
command: 'unlink <event-uri> <pipeline>',
8+
command: 'delete trigger <event-uri> <pipeline>',
9+
aliases: ['t'],
10+
parent: deleteRoot,
911
description: 'Delete trigger: unlink pipeline from `trigger-event`',
1012
webDocs: {
1113
category: 'Triggers',
12-
title: 'Remove Pipeline Trigger',
14+
title: 'Delete Pipeline Trigger',
1315
weight: 20,
1416
},
1517
builder: (yargs) => {
@@ -22,7 +24,7 @@ const command = new Command({
2224
describe: 'pipeline ID',
2325
required: true,
2426
})
25-
.example('codefresh unlink registry:dockerhub:codefresh:fortune:push 5a439664af73ad0001f3ece0', 'Remove trigger by unlinking 5a43... pipeline from the DockerHub `codefresh/fortune` `push` event');
27+
.example('codefresh delete trigger registry:dockerhub:codefresh:fortune:push 5a439664af73ad0001f3ece0', 'Delete trigger by unlinking 5a43... pipeline from the DockerHub `codefresh/fortune` `push` event');
2628
},
2729
handler: async (argv) => {
2830
/* eslint-disable prefer-destructuring */

lib/interface/cli/commands/trigger/event/delete.cmd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { trigger } = require('../../../../../logic').api;
55
const deleteRoot = require('../../root/delete.cmd');
66

77
const command = new Command({
8-
command: 'trigger-event [event-uri]',
8+
command: 'trigger-event <event-uri>',
99
parent: deleteRoot,
1010
description: 'Delete `trigger-event`',
1111
webDocs: {

lib/interface/cli/commands/trigger/get.cmd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const { specifyOutputForSingle, specifyOutputForArray } = require('../../helpers
66
const getRoot = require('../root/get.cmd');
77

88
const command = new Command({
9-
command: 'triggers',
9+
command: 'trigger',
1010
aliases: ['t'],
1111
parent: getRoot,
1212
description: 'Get triggers, optionally filtered by pipeline or event',

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "codefresh",
3-
"version": "0.8.30",
3+
"version": "0.8.31",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,
77
"scripts": {
88
"test": "jest .spec.js --coverage",
9-
"eslint": "eslint lib/logic/**",
9+
"eslint": "eslint lib1logic/**",
1010
"ci-publish": "ci-publish",
1111
"pkg": "pkg . -t node9-macos-x64,node9-linux-x64,node9-win-x64 --out-path ./dist",
1212
"serve-docs": "yarn build-local-docs && cd temp && hugo server -D",

0 commit comments

Comments
 (0)