Skip to content

Commit ff5e7ad

Browse files
add more events (#520)
1 parent 272680a commit ff5e7ad

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

lib/interface/cli/commands/hybrid/helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ function drawCodefreshFiglet() {
276276
return Promise.race(new Promise((resolve) => {
277277
figlet('CODEFRESH', (err, data) => {
278278
if (err) {
279-
return;
279+
resolve();
280280
}
281281
console.log(data);
282282
resolve();

lib/interface/cli/commands/hybrid/init.cmd.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ const initCmd = new Command({
332332
console.log(`A Codefresh Runner with the name: ${colors.cyan(agentName)} has been created.`);
333333
installationPlan.addContext('agentToken', agentToken);
334334
},
335+
installationEvent: installationProgress.events.AGENT_CREATED,
335336
condition: async () => !installationPlan.getContext('agentToken'),
336337
});
337338

@@ -351,6 +352,7 @@ const initCmd = new Command({
351352
agentId: installationPlan.getContext('agentName'),
352353
});
353354
},
355+
installationEvent: installationProgress.events.AGENT_INSTALLED,
354356
});
355357

356358
// generate new runtime name
@@ -412,6 +414,7 @@ const initCmd = new Command({
412414
terminateProcess: false,
413415
});
414416
},
417+
installationEvent: installationProgress.events.CLUSTER_INTEGRATION_ADDED,
415418
condition: async () => {
416419
const clusters = await sdk.clusters.list() || [];
417420
if (clusters.find(cluster => cluster.selector === kubeContextName)) {
@@ -439,6 +442,7 @@ const initCmd = new Command({
439442
storageClassName,
440443
});
441444
},
445+
installationEvent: installationProgress.events.RUNTIME_INSTALLED,
442446
});
443447

444448
// update agent with new runtime
@@ -463,6 +467,7 @@ const initCmd = new Command({
463467
throw new Error(`Runtime ${name} already attached`);
464468
}
465469
},
470+
installationEvent: installationProgress.events.AGENT_UPDATED,
466471
});
467472

468473
// attach runtime to agent

lib/interface/cli/commands/hybrid/installation-process.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,13 @@ module.exports = {
3232
buildReporter,
3333
events: {
3434
ACCEPTANCE_TESTS_RAN: 'acceptance-tests-ran',
35+
AGENT_INSTALLED: 'agent-installed',
36+
AGENT_CREATED: 'agent-created',
3537
RUNNER_INSTALLED: 'runner-installed',
3638
MONITOR_INSTALLED: 'monitor-installed',
39+
CLUSTER_INTEGRATION_ADDED: 'cluster-integration-added',
40+
AGENT_UPDATED: 'agent-updated',
41+
RUNTIME_INSTALLED: 'runtime-installed',
3742
PIPELINE_EXECUTED: 'demo-pipeline-executed',
3843
PIPELINE_CREATED: 'demo-pipeline-created',
3944
FINISHED: 'finished',

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.69.4",
3+
"version": "0.69.5",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,

0 commit comments

Comments
 (0)