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 */
|
/* add helper for checking change in commit */
|
||||||
Handlebars.registerHelper('commitChanged', commitHelper)
|
Handlebars.registerHelper('commitChanged', commitHelper)
|
||||||
/* setup templating for comments */
|
/* setup templating for comments */
|
||||||
this.template = Handlebars.compile(template);
|
Handlebars.registerPartial('build', template.build)
|
||||||
|
this.template = Handlebars.compile(template.main);
|
||||||
}
|
}
|
||||||
|
|
||||||
async renderComment (pr) {
|
async renderComment (pr) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
module.exports = `
|
const main = `
|
||||||
### Jenkins Builds
|
### Jenkins Builds
|
||||||
| :grey_question: | Commit | :hash: | Finished (UTC) | Duration | Platform | Result |
|
| :grey_question: | Commit | :hash: | Finished (UTC) | Duration | Platform | Result |
|
||||||
|-|-|-|-|-|-|-|
|
|-|-|-|-|-|-|-|
|
||||||
|
@ -6,10 +6,14 @@ module.exports = `
|
||||||
{{#commitChanged ../builds @index}}
|
{{#commitChanged ../builds @index}}
|
||||||
| | | | | | | |
|
| | | | | | | |
|
||||||
{{/commitChanged}}
|
{{/commitChanged}}
|
||||||
|
{{> build }}
|
||||||
|
{{/each}}
|
||||||
|
`
|
||||||
|
const build = `
|
||||||
{{#if this.success}}
|
{{#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 }}) |
|
| :heavy_check_mark: | {{ this.commit }} | [{{ this.id }}]({{ this.url }}) | {{date this.meta.created }} | {{ this.duration }} | \`{{ this.platform }}\` | [:package: package]({{ this.pkg_url }}) |
|
||||||
{{else}}
|
{{else}}
|
||||||
| :x: | {{ this.commit }} | [{{ this.id }}]({{ this.url }}) | {{date this.meta.created }} | {{ this.duration }} | \`{{ this.platform }}\` | [:page_facing_up: build log]({{ this.url }}consoleText) |
|
| :x: | {{ this.commit }} | [{{ this.id }}]({{ this.url }}) | {{date this.meta.created }} | {{ this.duration }} | \`{{ this.platform }}\` | [:page_facing_up: build log]({{ this.url }}consoleText) |
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/each}}
|
`.trim()
|
||||||
`
|
module.exports = { main, build }
|
||||||
|
|
Loading…
Reference in New Issue