Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Reorder messages #938

Merged
merged 1 commit into from
Oct 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 23 additions & 17 deletions src/tasks/che.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/component-installers/cert-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down
10 changes: 5 additions & 5 deletions src/tasks/installers/common-tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.`
}

}
Expand All @@ -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
}

Expand All @@ -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.`
}
}
}
Expand Down