Skip to content

Commit

Permalink
feat: default runtime environment for run command (#862)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-codefresh committed Aug 12, 2024
1 parent df8345b commit 32f181a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions lib/interface/cli/commands/pipeline/run.cf.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ class RunExternalCommand extends RunBaseCommand {
pipelineName,
options,
});
try {
if (options && options.runtimeName) {
await sdk.runtimeEnvs.get({ name: options.runtimeName, extend: false });
}
} catch (error) {
if (error.statusCode === 404) {
console.warn(`Runtime environment ${options.runtimeName} not found. Default runtime will be used.`);
}
}
this.workflowId = await sdk.pipelines[interfaceMethod]({ name: pipelineName }, _buildBody(options));
if (this.executionRequests.length === 1) {
if (this.argv.returnWorkflowId) {
Expand Down
2 changes: 1 addition & 1 deletion lib/logic/entities/RuntimeEnvironments.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class RuntimeEnvironments extends Entity {
return new RuntimeEnvironments(_.pick(response, [
'version', 'metadata', 'environmentCertPath', 'runtimeScheduler',
'dockerDaemonScheduler', 'history', 'extends', 'description', 'isPublic',
'isDefault', 'accountId', 'plan', 'accounts', 'nonComplete', 'appProxy',
'isDefault', 'accountId', 'plan', 'accounts', 'nonComplete', 'appProxy', 'tags',
]));
}
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codefresh",
"version": "0.87.5",
"version": "0.87.6",
"description": "Codefresh command line utility",
"main": "index.js",
"preferGlobal": true,
Expand Down Expand Up @@ -115,4 +115,4 @@
"./test-setup.js"
]
}
}
}

0 comments on commit 32f181a

Please sign in to comment.