Reduced escaping and use multiline

This commit is contained in:
Liam Newman 2018-01-04 13:57:53 -08:00 committed by GitHub
parent 51c379a8aa
commit 0db8eb8379
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -33,10 +33,19 @@ def call(Map args) {
returnStdout: true).trim()
}
if (uploadedUrl =~ /https\:\/\//) {
if (uploadedUrl =~ 'https://') {
/* if the output was a URL, generate our redirect file */
String redirectFile = "${args.artifacts}.html"
String redirectHtml = "<html><head><meta http-equiv=\"refresh\" content=\"0;URL=${uploadedUrl}\" /><title>Redirecting...</title></head><body><center>${args.artifacts} can be downloaded <a href=\"${uploadedUrl}\">from Azure</a></center></body></html>"
String redirectHtml = """<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="0;URL=${uploadedUrl}" />
<title>Redirecting...</title>
</head>
<body>
<center>${args.artifacts} can be downloaded <a href="${uploadedUrl}">from Azure</a></center>
</body>
</html>"""
writeFile file: redirectFile, text:redirectHtml
steps.archiveArtifacts redirectFile
}