Skip to content

Instantly share code, notes, and snippets.

@YoungjaeKim
Last active April 23, 2018 10:16
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save YoungjaeKim/cf35ef3cba344a2f85e9 to your computer and use it in GitHub Desktop.
Save YoungjaeKim/cf35ef3cba344a2f85e9 to your computer and use it in GitHub Desktop.
Teamcity Email Notification template to give direct download link of an artifact.
<#-- Uses FreeMarker template syntax, template guide can be found at http://freemarker.org/docs/dgui.html -->
<#import "common.ftl" as common>
<#import "responsibility.ftl" as resp>
<#global subject>[<@common.subjMarker/>, SUCCESSFUL] Build ${project.fullName} :: ${buildType.name} <@common.short_build_info build/></#global>
<#global body>Build ${project.fullName} :: ${buildType.name} <@common.short_build_info build/> successful ${var.buildShortStatusDescription}.
<@resp.buildTypeInvestigation buildType true/>
Agent: ${agentName}
Build results: ${link.buildResultsLink}
${var.buildCompilationErrors}${var.buildFailedTestsErrors}${var.buildChanges}
<@common.footer/></#global>
<#global bodyHtml>
<div>
<div>
Build <b>${project.fullName?html} :: ${buildType.name?html}</b> <a href='${link.buildResultsLink}'><@common.short_build_info build/></a> successful
${var.buildShortStatusDescription}
</div>
<div><@resp.buildTypeInvestigation buildType true/></div>
<@common.build_agent build/>
<@common.build_comment build/>
<#-- MODIFICATION START -->
<#-- You can make conditional process with build.name = "PROJECT_NAME" && buildType.name="CONFIGURATION_NAME" instead. -->
<#if buildType.externalId = "YOUR_BUILD_CONFIGURATION_ID">
<br>
<a href='http://www.your-teamcity-site.net/repository/download/${buildType.externalId}/.lastSuccessful/bapul-release-${build.buildNumber}.apk'>Click here to download apk.</a>
<br>
</#if>
<#-- MODIFICATION END -->
<br>
<@common.build_changes var.changesBean/>
<@common.compilation_errors var.compilationBean/>
<@common.test_errors var.failedTestsBean/>
<@common.footerHtml/>
</div>
</#global>
@YoungjaeKim
Copy link
Author

For visitors. please see line 26 to 33.

Copy link

ghost commented Jan 22, 2016

This is great! Thx a lot for sharing. Saved me quite some time....

@ygsh
Copy link

ygsh commented Sep 14, 2016

Hi,

Please let me know if we can render the content on an HTML artifact in email notifier from Teamcity. I need this as some of my teammates don't have login rights to our TC server.

Thanks,
Ygsh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment