Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,17 @@ buddy-cli pl r [pipeline]
```
Options:
```
-v, --version Show version
-h, --help Show help
-j, --json Output json
-t, --token The token used to authenticate the request
-u, --url The base URL for the app (default: api.buddy.works)
-w, --workspace The name of the workspace in which the command is run
-p, --project The name of the project in which the command is run
-r, --revision The revision from the repository that will be executed in the pipeline
-c, --comment The execution comment
-f, --refresh Execute from scratch
-v, --version Show version
-h, --help Show help
-j, --json Output json
-t, --token The token used to authenticate the request
-u, --url The base URL for the app (default: api.buddy.works)
-w, --workspace The name of the workspace in which the command is run
-p, --project The name of the project in which the command is run
-r, --revision The revision from the repository that will be executed in the pipeline
-c, --comment The execution comment
-f, --refresh Execute from scratch
-e, --environment Set environment variables for this execution
```

#### Retry pipeline
Expand Down
8 changes: 8 additions & 0 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,14 @@ function Api() {
}
if (args.comment) params.comment = args.comment;
if (args.refresh) params.refresh = true;
if (args.environment) {
let variables = args.environment;
if (!Array.isArray(variables)) variables = [variables];
params.variables = variables.map((pair) => {
let [key, value] = pair.split(/=(.+)/);
return {key, value};
});
}
client.post('/workspaces/:workspace/projects/:project/pipelines/:pipeline/executions', {}, args, params, done);
};
/**
Expand Down
5 changes: 5 additions & 0 deletions src/cmds/pipeline/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ module.exports.builder = {
describe: 'Execute from scratch',
type: 'boolean',
},
e: {
alias: 'environment',
describe: 'Set environment variables',
type: 'string',
},
};

module.exports.request = (args, done) => api.runPipeline(args, done);
Expand Down