Skip to content

Commit 6073726

Browse files
author
Oleg Sucharevich
authored
support deletion of runtime environment (#446)
1 parent 73beb09 commit 6073726

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

lib/interface/cli/commands/runtimeEnvironments/create.cmd.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
const Command = require('../../Command');
22
const createRoot = require('../root/create.cmd');
33

4-
const DEPRECATION_MESSAGE = 'Create runtime-environment command has been deprecated. Please use Venona to create a runtime-environment';
5-
const VENONA_REPO_URL = 'https://github.com/codefresh-io/venona';
4+
const DEPRECATION_MESSAGE = 'Create runtime-environment command has been deprecated.\nUse codefresh install runtime command instead';
65

76
const command = new Command({
87
command: 'runtime-environments [cluster]',
@@ -15,7 +14,7 @@ const command = new Command({
1514
weight: 100,
1615
},
1716
handler: async () => {
18-
console.log(`${DEPRECATION_MESSAGE} ${VENONA_REPO_URL}`);
17+
console.log(`${DEPRECATION_MESSAGE}`);
1918
process.exit(1);
2019
},
2120
});

lib/interface/cli/commands/runtimeEnvironments/delete.cmd.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
const debug = require('debug')('codefresh:cli:create:pipelines2');
12
const Command = require('../../Command');
3+
const { sdk } = require('../../../../logic');
24
const deleteRoot = require('../root/delete.cmd');
35

4-
const DEPRECATION_MESSAGE = 'Create runtime-environment is been deprecated. Please use Venona to delete a runtime-environment';
5-
const VENONA_REPO_URL = 'https://github.com/codefresh-io/venona';
6-
76

87
const command = new Command({
98
command: 'runtime-environments name',
@@ -14,9 +13,20 @@ const command = new Command({
1413
category: 'Runtime-Environments',
1514
title: 'Delete Runtime-Environments',
1615
},
17-
handler: async () => {
18-
console.log(`${DEPRECATION_MESSAGE} ${VENONA_REPO_URL}`);
19-
process.exit(1);
16+
builder: (yargs) => {
17+
return yargs
18+
.positional('name', {
19+
describe: 'Runtime environment name',
20+
})
21+
.option('force', {
22+
describe: 'Delete runtime environment in force mode',
23+
type: 'boolean',
24+
});
25+
},
26+
handler: async (argv) => {
27+
const { name, force } = argv;
28+
await sdk.runtimeEnvs.delete({ name, force });
29+
console.log(`Runtime-Environment '${name}' deleted.`);
2030
},
2131
});
2232

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codefresh",
3-
"version": "0.53.0",
3+
"version": "0.54.0",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,

0 commit comments

Comments
 (0)