From 3e7bcf78472968ee0f4f967645f7bd1f89e69b27 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Mon, 19 Oct 2020 16:27:20 +0300 Subject: [PATCH] Reorder messages Signed-off-by: Anatolii Bazko --- src/tasks/che.ts | 40 +++++++++++-------- .../component-installers/cert-manager.ts | 2 +- src/tasks/installers/common-tasks.ts | 10 ++--- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/src/tasks/che.ts b/src/tasks/che.ts index fcaced449..14166f50a 100644 --- a/src/tasks/che.ts +++ b/src/tasks/che.ts @@ -616,37 +616,43 @@ export class CheTasks { { title: 'Prepare post installation output', task: async (ctx: any, task: any) => { + const messages: string[] = [] + const version = await VersionHelper.getCheVersion(flags) - ctx.highlightedMessages.push(`Eclipse Che ${version.trim()} has successfully installed.`) + messages.push(`Eclipse Che ${version.trim()} has been successfully deployed.`) + messages.push(`Documentation : ${DOC_LINK}`) + if (DOC_LINK_RELEASE_NOTES) { + messages.push(`Release Notes : ${DOC_LINK_RELEASE_NOTES}`) + } + messages.push('') const cheUrl = await this.che.cheURL(flags.chenamespace) - ctx.highlightedMessages.push(`Users can access the Dashboard at : ${cheUrl}`) + messages.push(`Users Dashboard : ${cheUrl}`) + const cheCluster = await this.kube.getCheCluster(flags.chenamespace) + if (cheCluster && cheCluster.spec.auth && cheCluster.spec.auth.updateAdminPassword) { + messages.push('Admin user login : "admin:admin". NOTE: must change after first login.') + } + messages.push('') const cheConfigMap = await this.kube.getConfigMap('che', flags.chenamespace) if (cheConfigMap && cheConfigMap.data) { if (cheConfigMap.data.CHE_WORKSPACE_PLUGIN__REGISTRY__URL) { - ctx.highlightedMessages.push(`Plugins can be viewed at : ${cheConfigMap.data.CHE_WORKSPACE_PLUGIN__REGISTRY__URL}`) + messages.push(`Plug-in Registry : ${cheConfigMap.data.CHE_WORKSPACE_PLUGIN__REGISTRY__URL}`) } if (cheConfigMap.data.CHE_WORKSPACE_DEVFILE__REGISTRY__URL) { - ctx.highlightedMessages.push(`Devfiles can be viewed at : ${cheConfigMap.data.CHE_WORKSPACE_DEVFILE__REGISTRY__URL}`) + messages.push(`Devfile Registry : ${cheConfigMap.data.CHE_WORKSPACE_DEVFILE__REGISTRY__URL}`) } + messages.push('') + if (cheConfigMap.data.CHE_KEYCLOAK_AUTH__SERVER__URL) { - ctx.highlightedMessages.push(`Identity provider can be accessed at: ${cheConfigMap.data.CHE_KEYCLOAK_AUTH__SERVER__URL}`) + messages.push(`Identity Provider URL : ${cheConfigMap.data.CHE_KEYCLOAK_AUTH__SERVER__URL}`) } - ctx.highlightedMessages.push(`Product documentation is at : ${DOC_LINK}`) - if (DOC_LINK_RELEASE_NOTES) { - ctx.highlightedMessages.push(`Release Notes are at : ${DOC_LINK_RELEASE_NOTES}`) + if (ctx.identityProviderUsername && ctx.identityProviderPassword) { + messages.push(`Identity Provider login : "${ctx.identityProviderUsername}:${ctx.identityProviderPassword}".`) } + messages.push('') } - - const cheCluster = await this.kube.getCheCluster(flags.chenamespace) - if (cheCluster && cheCluster.spec.auth && cheCluster.spec.auth.updateAdminPassword) { - ctx.highlightedMessages.push('Eclipse Che admin credentials : "admin:admin". You will be asked to change default Che admin password on the first login.') - } - if (ctx.identityProviderUsername && ctx.identityProviderPassword) { - ctx.highlightedMessages.push(`Identity Provider credentials : "${ctx.identityProviderUsername}:${ctx.identityProviderPassword}".`) - } - + ctx.highlightedMessages = messages.concat(ctx.highlightedMessages) task.title = `${task.title}...done` } } diff --git a/src/tasks/component-installers/cert-manager.ts b/src/tasks/component-installers/cert-manager.ts index 767ee5e67..134e72797 100644 --- a/src/tasks/component-installers/cert-manager.ts +++ b/src/tasks/component-installers/cert-manager.ts @@ -175,7 +175,7 @@ export class CertManagerTasks { await this.kubeHelper.createSecret(CHE_ROOT_CA_SECRET_NAME, { 'ca.crt': cheCaCrt }, flags.chenamespace) ctx.highlightedMessages.push(getMessageImportCaCertIntoBrowser(cheCaCertPath)) - task.title = `${task.title}... is exported to ${cheCaCertPath}` + task.title = `${task.title}... done` } else { throw new Error('Failed to get Cert Manager CA secret') } diff --git a/src/tasks/installers/common-tasks.ts b/src/tasks/installers/common-tasks.ts index f4f6f87ef..45eeda519 100644 --- a/src/tasks/installers/common-tasks.ts +++ b/src/tasks/installers/common-tasks.ts @@ -105,10 +105,10 @@ export function retrieveCheCaCertificateTask(flags: any): Listr.ListrTask { if (cheCaCert) { const targetFile = await che.saveCheCaCert(cheCaCert) - task.title = `${task.title }... done` + task.title = `${task.title}... done` ctx.highlightedMessages.push(getMessageImportCaCertIntoBrowser(targetFile)) } else { - task.title = `${task.title }... commonly trusted certificate is used.` + task.title = `${task.title}... commonly trusted certificate is used.` } } @@ -117,7 +117,7 @@ export function retrieveCheCaCertificateTask(flags: any): Listr.ListrTask { export function getMessageImportCaCertIntoBrowser(caCertFileLocation: string): string { const message = `${ansi.yellow('[ACTION REQUIRED]')} Please add Che self-signed CA certificate into your browser: ${caCertFileLocation}.\n` + - `Documentation how to add a CA certificate into a browser: ${DOCS_LINK_IMPORT_CA_CERT_INTO_BROWSER}` + `Documentation how to add a CA certificate into a browser: ${DOCS_LINK_IMPORT_CA_CERT_INTO_BROWSER}` return message } @@ -131,9 +131,9 @@ export function getRetrieveKeycloakCredentialsTask(flags: any): Listr.ListrTask if (login && password) { ctx.identityProviderUsername = login ctx.identityProviderPassword = password - task.title = `${task.title }...done` + task.title = `${task.title}...done` } else { - task.title = `${task.title }...failed.` + task.title = `${task.title}...failed.` } } }