@solidactions/cli 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/run.js +6 -2
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/dist/commands/run.js
CHANGED
|
@@ -13,7 +13,11 @@ async function run(projectName, workflowName, options) {
|
|
|
13
13
|
console.error(chalk_1.default.red('Not initialized. Run "solidactions init <api-key>" first.'));
|
|
14
14
|
process.exit(1);
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
const environment = options.env || 'dev';
|
|
17
|
+
const projectSlug = environment === 'production'
|
|
18
|
+
? projectName
|
|
19
|
+
: `${projectName}-${environment}`;
|
|
20
|
+
console.log(chalk_1.default.blue(`Running workflow "${workflowName}" in project "${projectName}" (${environment})...`));
|
|
17
21
|
let inputData = {};
|
|
18
22
|
if (options.input) {
|
|
19
23
|
try {
|
|
@@ -25,7 +29,7 @@ async function run(projectName, workflowName, options) {
|
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
try {
|
|
28
|
-
const response = await axios_1.default.post(`${config.host}/api/v1/projects/${
|
|
32
|
+
const response = await axios_1.default.post(`${config.host}/api/v1/projects/${projectSlug}/workflows/${workflowName}/trigger`, { input: inputData }, {
|
|
29
33
|
headers: {
|
|
30
34
|
'Authorization': `Bearer ${config.apiKey}`,
|
|
31
35
|
'Accept': 'application/json',
|
package/dist/index.js
CHANGED
|
@@ -76,6 +76,7 @@ program
|
|
|
76
76
|
.description('Trigger a workflow run')
|
|
77
77
|
.argument('<project>', 'Project name')
|
|
78
78
|
.argument('<workflow>', 'Workflow name')
|
|
79
|
+
.option('-e, --env <environment>', 'Environment (production/staging/dev)', 'dev')
|
|
79
80
|
.option('-i, --input <json>', 'JSON input for the workflow')
|
|
80
81
|
.option('-w, --wait', 'Wait for the workflow to complete')
|
|
81
82
|
.action((project, workflow, options) => {
|