Skip to content

Commit 27b9bc4

Browse files
committed
JPERF-273: Check Jira HTML when upgrade fails
1 parent 961107c commit 27b9bc4

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/main/kotlin/com/atlassian/performance/tools/infrastructure/api/jira/start/hook/RestUpgrade.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import com.atlassian.performance.tools.infrastructure.api.jira.report.FileListin
66
import com.atlassian.performance.tools.infrastructure.api.jira.report.Reports
77
import com.atlassian.performance.tools.infrastructure.api.jira.start.StartedJira
88
import com.atlassian.performance.tools.infrastructure.api.jvm.ThreadDump
9+
import com.atlassian.performance.tools.infrastructure.jira.report.JiraLandingPage
910
import com.atlassian.performance.tools.ssh.api.SshConnection
1011
import java.net.URI
1112
import java.time.Duration
@@ -70,6 +71,7 @@ class RestUpgrade(
7071
if (deadline < Instant.now()) {
7172
reports.add(JiraLogs().report(jira.installed), jira)
7273
reports.add(FileListing("thread-dumps/*"), jira)
74+
reports.add(JiraLandingPage(jira), jira)
7375
throw Exception("$upgradesEndpoint failed to get out of $statusQuo status within $timeout")
7476
}
7577
threadDump.gather(ssh, "thread-dumps")
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.atlassian.performance.tools.infrastructure.jira.report
2+
3+
import com.atlassian.performance.tools.infrastructure.api.jira.report.Report
4+
import com.atlassian.performance.tools.infrastructure.api.jira.start.StartedJira
5+
import com.atlassian.performance.tools.infrastructure.api.os.Ubuntu
6+
import com.atlassian.performance.tools.ssh.api.SshConnection
7+
8+
internal class JiraLandingPage(
9+
private val started: StartedJira
10+
) : Report {
11+
override fun locate(ssh: SshConnection): List<String> {
12+
Ubuntu().install(ssh, listOf("curl"))
13+
val landingPage = started.installed.http.addressPrivately()
14+
val html = "jira-landing-page.html"
15+
val headers = "jira-landing-page-headers.txt"
16+
ssh.execute("curl $landingPage --location --output $html --dump-header $headers --silent")
17+
return listOf(html, headers)
18+
}
19+
}

0 commit comments

Comments
 (0)