Skip to content

Commit a20f1c1

Browse files
fix doc and add support for commit id (#191)
1 parent 24635d5 commit a20f1c1

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

lib/interface/cli/Command.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,7 @@ class Command {
231231
}
232232
let aliases = '';
233233
if (option.value.alias) {
234-
let aliasString = '';
235-
_.forEach(option.value.alias, (alias) => {
236-
aliasString += `- ${alias}`;
237-
});
238-
aliases += aliasString;
234+
aliases += `- ${option.value.alias}`;
239235
}
240236
const defaultValue = option.value.default || '';
241237
res.options[group] += `--${key} | ${aliases} | ${defaultValue} | ${description}\n`;

lib/interface/cli/commands/pipeline/run.cmd.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const authManager = require('../../../../logic').auth.manager;
1111
const run = new Command({
1212
root: true,
1313
command: 'run <name>',
14-
description: 'Run a pipeline and attach the created workflow logs.',
14+
description: 'Run a pipeline by id or name and attach the created workflow logs.',
1515
usage: 'Returns an exit code according to the workflow finish status (Success: 0, Error: 1, Terminated: 2)',
1616
webDocs: {
1717
category: 'Pipelines',
@@ -55,11 +55,11 @@ const run = new Command({
5555
describe: 'Run pipeline with contexts',
5656
default: [],
5757
})
58-
.example('codefresh run PIPELINE_ID -b=master', 'Defining the source control context using a branch')
59-
.example('codefresh run PIPELINE_ID -s=52b992e783d2f84dd0123c70ac8623b4f0f938d1', 'Defining the source control context using a commit')
60-
.example('codefresh run PIPELINE_ID -b=master -v key1=value1 -v key2=value2', 'Setting variables through the command')
61-
.example('codefresh run PIPELINE_ID -b=master --var-file ./var_file.yml', 'Settings variables through a yml file')
62-
.example('codefresh run PIPELINE_ID -b=master --context context', 'Inject contexts to the pipeline execution');
58+
.example('codefresh run PIPELINE_ID | PIPELINE_NAME -b=master', 'Defining the source control context using a branch')
59+
.example('codefresh run PIPELINE_ID | PIPELINE_NAME -s=52b992e783d2f84dd0123c70ac8623b4f0f938d1', 'Defining the source control context using a commit')
60+
.example('codefresh run PIPELINE_ID | PIPELINE_NAME -b=master -v key1=value1 -v key2=value2', 'Setting variables through the command')
61+
.example('codefresh run PIPELINE_ID | PIPELINE_NAME -b=master --var-file ./var_file.yml', 'Settings variables through a yml file')
62+
.example('codefresh run PIPELINE_ID | PIPELINE_NAME -b=master --context context', 'Inject contexts to the pipeline execution');
6363

6464
crudFilenameOption(yargs, {
6565
name: 'variable-file',

lib/logic/api/workflow.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const _extractFieldsForWorkflowEntity = (workflow) => {
2525
trigger: workflow.trigger,
2626
progress: workflow.progress,
2727
'pipeline-Id': workflow.serviceId,
28+
'commit-Id': workflow.revision,
2829
};
2930
};
3031

lib/logic/entities/Workflow.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class Workflow extends Entity {
1717
'trigger',
1818
'repository',
1919
'branch',
20+
'commit-Id',
2021
];
2122
}
2223

0 commit comments

Comments
 (0)