move the list of builds to a separate partial
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
ab488cb9dd
commit
080139a2df
|
@ -34,7 +34,8 @@ class Comments {
|
|||
/* add helper for checking change in commit */
|
||||
Handlebars.registerHelper('commitChanged', commitHelper)
|
||||
/* setup templating for comments */
|
||||
this.template = Handlebars.compile(template);
|
||||
Handlebars.registerPartial('build', template.build)
|
||||
this.template = Handlebars.compile(template.main);
|
||||
}
|
||||
|
||||
async renderComment (pr) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module.exports = `
|
||||
const main = `
|
||||
### Jenkins Builds
|
||||
| :grey_question: | Commit | :hash: | Finished (UTC) | Duration | Platform | Result |
|
||||
|-|-|-|-|-|-|-|
|
||||
|
@ -6,10 +6,14 @@ module.exports = `
|
|||
{{#commitChanged ../builds @index}}
|
||||
| | | | | | | |
|
||||
{{/commitChanged}}
|
||||
{{> build }}
|
||||
{{/each}}
|
||||
`
|
||||
const build = `
|
||||
{{#if this.success}}
|
||||
| :heavy_check_mark: | {{ this.commit }} | [{{ this.id }}]({{ this.url }}) | {{date this.meta.created }} | {{ this.duration }} | \`{{ this.platform }}\` | [:package: package]({{ this.pkg_url }}) |
|
||||
{{else}}
|
||||
| :x: | {{ this.commit }} | [{{ this.id }}]({{ this.url }}) | {{date this.meta.created }} | {{ this.duration }} | \`{{ this.platform }}\` | [:page_facing_up: build log]({{ this.url }}consoleText) |
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
`
|
||||
`.trim()
|
||||
module.exports = { main, build }
|
||||
|
|
Loading…
Reference in New Issue