Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ hs_err_pid*
.project
.settings
.classpath
.gradle
.gradle
patched/
32 changes: 4 additions & 28 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,27 @@ Posts Build Status to [Slack](http://www.slack.com)
![Sample Notification](https://raw.github.com/petegoo/tcSlackBuildNotifier/master/docs/build-status_pass.png)
![Sample Notification](https://raw.github.com/petegoo/tcSlackBuildNotifier/master/docs/build-status_fail.png)

_Tested on TeamCity 8.1.2 (build 29993), 9.1 (build 36973)_
## What's New

This is fork of https://github.com/PeteGoo/tcSlackBuildNotifier, with ability to customize message with freemarker templates, including any build parameters into the message.

For example, if the builds have any of parameters `newVersion`, `toVersion`, `testMode`, `emailToAddress` or `services`, for the message body defined as
```
<#if newVersion?has_content || toVersion?has_content>: ${newVersion}${toVersion}</#if>
<#if testMode?has_content && testMode="true"> `TEST MODE`</#if>
<#if emailToAddress?has_content> to ${emailToAddress} about</#if>
<#if services?has_content>: ${services}</#if>
```

Like this:
![Configuration](https://raw.github.com/Ecwid/tcSlackBuildNotifier/master/docs/configuration.png)

We will see the following message in Slack:

![Sample Notification](https://raw.github.com/Ecwid/tcSlackBuildNotifier/master/docs/custom_message.png)

Also there is ability to remove header and make compact one line message format (if "Message title" is not specified, and other build options are not selected).


## Installation
Head over to the [releases](https://github.com/PeteGoo/tcSlackBuildNotifier/releases) section and get the zip labelled `tcSlackNotifierPlugin.zip` from there (do not download the one on this page). Copy the zip file into your [team city plugins directory](https://confluence.jetbrains.com/display/TCD9/Installing+Additional+Plugins)
Expand Down
Binary file added docs/configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/custom_message.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 19 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>tcslackbuildnotifier</artifactId>
<properties>
<majorVersion>1.4</majorVersion>
<minorVersion>5</minorVersion>
<minorVersion>7-ecwid</minorVersion>
<currentVersion>${majorVersion}.${minorVersion}</currentVersion>
</properties>
<version>${currentVersion}</version>
Expand Down Expand Up @@ -60,8 +60,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -164,30 +164,30 @@
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.0.1</version>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-project-info-reports-plugin</artifactId>-->
<!-- <version>2.0.1</version>-->
<!-- </plugin>-->

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.1</version>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-javadoc-plugin</artifactId>-->
<!-- <version>2.1</version>-->
<!-- </plugin>-->
<!-- -->
<!-- <plugin>-->
<!-- <groupId>org.codehaus.mojo</groupId>-->
<!-- <artifactId>cobertura-maven-plugin</artifactId>-->
<!-- </plugin>-->

</plugins>
</reporting>

<repositories>
<repository>
<id>tcslacknotifications.sourceforge</id>
<url>http://svn.code.sf.net/p/tcplugins/code/maven2-repo</url>
<url>https://svn.code.sf.net/p/tcplugins/code/maven2-repo</url>
</repository>
<!-- <repository>
<id>jetbrains-all</id>
Expand Down
29 changes: 14 additions & 15 deletions tcslackbuildnotifier-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -96,7 +96,7 @@
<repositories>
<repository>
<id>tcslacknotifications.sourceforge</id>
<url>http://svn.code.sf.net/p/tcplugins/code/maven2-repo</url>
<url>https://svn.code.sf.net/p/tcplugins/code/maven2-repo</url>
</repository>
<!-- <repository> <id>jetbrains-all</id> <url>http://repository.jetbrains.com/all</url>
</repository> -->
Expand Down Expand Up @@ -211,23 +211,16 @@
</dependency>

<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>6.1.16</version>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>12.0.21</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mortbay.jetty</groupId>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-client</artifactId>
<version>6.1.16</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-sslengine</artifactId>
<version>6.1.16</version>
<version>12.0.21</version>
<scope>test</scope>
</dependency>

Expand All @@ -254,6 +247,12 @@
</dependency>


<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker-gae</artifactId>
<version>2.3.25-incubating</version>
</dependency>

</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@ public interface SlackNotification {

public abstract void setBotName(String botName);

public abstract String getIconUrl();
String getTemplateTitle();

void setTemplateTitle(String templateTitle);

String getTemplateBody();

void setTemplateBody(String templateBody);

public abstract String getIconUrl();

public abstract void setIconUrl(String iconUrl);

Expand Down
Loading