From d122749348d196b8626225d8741e6cdcb6e714bd Mon Sep 17 00:00:00 2001 From: Ethan Rogers Date: Tue, 7 May 2019 10:38:34 -0400 Subject: [PATCH] feat(runJob/kubernetes): render external link (#6930) if `context.execution.logs` is present (pulled from manifest annotation `jobs.spinnaker.io/logs`), render the content as a link, templated with manifest data. --- .../manifest/stage/JobStageExecutionLogs.tsx | 28 +++++++++++++++++-- .../PreconfiguredJobExecutionDetails.tsx | 2 ++ .../stages/runJob/RunJobExecutionDetails.tsx | 2 ++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/app/scripts/modules/core/src/manifest/stage/JobStageExecutionLogs.tsx b/app/scripts/modules/core/src/manifest/stage/JobStageExecutionLogs.tsx index cf4dd69100e..2b2560ea19b 100644 --- a/app/scripts/modules/core/src/manifest/stage/JobStageExecutionLogs.tsx +++ b/app/scripts/modules/core/src/manifest/stage/JobStageExecutionLogs.tsx @@ -5,7 +5,7 @@ import { IStageManifest, ManifestService } from '../ManifestService'; import { JobManifestPodLogs } from './JobManifestPodLogs'; import { IManifest } from 'core/domain/IManifest'; -import { get } from 'lodash'; +import { get, template, isEmpty } from 'lodash'; import { Application } from 'core/application'; interface IJobStageExecutionLogsProps { @@ -13,6 +13,7 @@ interface IJobStageExecutionLogsProps { deployedName: string; account: string; application: Application; + externalLink: string; } interface IJobStageExecutionLogsState { @@ -30,7 +31,7 @@ export class JobStageExecutionLogs extends React.Component + Console Output (External) + + ); + } + let event: any = null; if (manifest && manifest.events) { event = manifest.events.find((e: any) => e.message.startsWith('Created pod')); } - if (!manifest || !event) { + + if (isEmpty(manifest) && isEmpty(event)) { return
No Console Output
; } diff --git a/app/scripts/modules/core/src/pipeline/config/stages/preconfiguredJob/PreconfiguredJobExecutionDetails.tsx b/app/scripts/modules/core/src/pipeline/config/stages/preconfiguredJob/PreconfiguredJobExecutionDetails.tsx index bd2689767b3..4059f39ee06 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/preconfiguredJob/PreconfiguredJobExecutionDetails.tsx +++ b/app/scripts/modules/core/src/pipeline/config/stages/preconfiguredJob/PreconfiguredJobExecutionDetails.tsx @@ -21,6 +21,7 @@ export class PreconfiguredJobExecutionDetails extends React.Component(this.props.stage, ['context', 'execution', 'logs']); return (
); diff --git a/app/scripts/modules/kubernetes/src/v2/pipelines/stages/runJob/RunJobExecutionDetails.tsx b/app/scripts/modules/kubernetes/src/v2/pipelines/stages/runJob/RunJobExecutionDetails.tsx index 4ddade274cd..b3cb8a815cd 100644 --- a/app/scripts/modules/kubernetes/src/v2/pipelines/stages/runJob/RunJobExecutionDetails.tsx +++ b/app/scripts/modules/kubernetes/src/v2/pipelines/stages/runJob/RunJobExecutionDetails.tsx @@ -28,6 +28,7 @@ export class RunJobExecutionDetails extends React.Component(stage, ['context', 'execution', 'logs']); return ( @@ -51,6 +52,7 @@ export class RunJobExecutionDetails extends React.Component