diff --git a/src/main/kotlin/com/atlassian/performance/tools/infrastructure/api/jira/start/hook/RestUpgrade.kt b/src/main/kotlin/com/atlassian/performance/tools/infrastructure/api/jira/start/hook/RestUpgrade.kt index e9e3b9b5..3762f7d2 100644 --- a/src/main/kotlin/com/atlassian/performance/tools/infrastructure/api/jira/start/hook/RestUpgrade.kt +++ b/src/main/kotlin/com/atlassian/performance/tools/infrastructure/api/jira/start/hook/RestUpgrade.kt @@ -6,6 +6,7 @@ import com.atlassian.performance.tools.infrastructure.api.jira.report.FileListin import com.atlassian.performance.tools.infrastructure.api.jira.report.Reports import com.atlassian.performance.tools.infrastructure.api.jira.start.StartedJira import com.atlassian.performance.tools.infrastructure.api.jvm.ThreadDump +import com.atlassian.performance.tools.infrastructure.jira.report.JiraLandingPage import com.atlassian.performance.tools.ssh.api.SshConnection import java.net.URI import java.time.Duration @@ -70,6 +71,7 @@ class RestUpgrade( if (deadline < Instant.now()) { reports.add(JiraLogs().report(jira.installed), jira) reports.add(FileListing("thread-dumps/*"), jira) + reports.add(JiraLandingPage(jira), jira) throw Exception("$upgradesEndpoint failed to get out of $statusQuo status within $timeout") } threadDump.gather(ssh, "thread-dumps") diff --git a/src/main/kotlin/com/atlassian/performance/tools/infrastructure/jira/report/JiraLandingPage.kt b/src/main/kotlin/com/atlassian/performance/tools/infrastructure/jira/report/JiraLandingPage.kt new file mode 100644 index 00000000..8d0b1302 --- /dev/null +++ b/src/main/kotlin/com/atlassian/performance/tools/infrastructure/jira/report/JiraLandingPage.kt @@ -0,0 +1,19 @@ +package com.atlassian.performance.tools.infrastructure.jira.report + +import com.atlassian.performance.tools.infrastructure.api.jira.report.Report +import com.atlassian.performance.tools.infrastructure.api.jira.start.StartedJira +import com.atlassian.performance.tools.infrastructure.api.os.Ubuntu +import com.atlassian.performance.tools.ssh.api.SshConnection + +internal class JiraLandingPage( + private val started: StartedJira +) : Report { + override fun locate(ssh: SshConnection): List { + Ubuntu().install(ssh, listOf("curl")) + val landingPage = started.installed.http.addressPrivately() + val html = "jira-landing-page.html" + val headers = "jira-landing-page-headers.txt" + ssh.execute("curl $landingPage --location --output $html --dump-header $headers --silent") + return listOf(html, headers) + } +}