Giter Site home page Giter Site logo

kortov / teamcity-telegram-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from itglvb/teamcity-telegram-plugin

0.0 1.0 1.0 734 KB

TeamCity notifications for Telegram messenger

License: Apache License 2.0

Java 77.49% CSS 0.34% JavaScript 4.81% FreeMarker 17.35%

teamcity-telegram-plugin's Introduction

Fork Telegram Notifier

TeamCity notifications for Telegram messenger

Added support :

  • Markdown
  • Emoji

Installation

To install plugin download zip archive it and copy it to Teamcity <data directory>/plugins (it is $HOME/.BuildServer/plugins under Linux and C:\ProgramData\JetBrains\TeamCity\plugins under Windows). For more information, take a look at official documentation

Configuration

Plugin adds new section "Telegram Notifier" under profile and administration pages.

Administration page

Enter bot token. What it is? To use telegram plugin you should create telegram bot. It sends messages to subscribers. Firstly find BotFather (case sensitive) bot. Then send /newbot command. Enter name and username of new bot. After that, response should contains line like 110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw. It's bot token. More information about creation of bots you can find in Telegram documentation. admin page

Profile page

Telegram bot can't send messages by username or to user who never write to it. So when Teamcity is running send any message to bot. Response should contains you chat id. Add that chat id under profile page. profile page

TODO

  1. This sources contains freemarker templates from Teamcity Jabber plugin. Maybe it violates license. Anybody can view and edit this resources. And this is officially supported by Jetbrains. So I hope there is no problem. But in any case I hope I will be able to know it soon. Of course plugin can simply use same templates from jabber config directory directly, but it's strange.
  2. Managing build start from Telegram application.
  3. Right know I don't understand how to properly test Teamcity plugins.

teamcity-telegram-plugin's People

Contributors

dancing-elf avatar itglvb avatar kortov avatar mrpess1m1st avatar

Watchers

 avatar

Forkers

rusguliev

teamcity-telegram-plugin's Issues

add tests

For a start add tests for bot, but bot should be mockable, there should not be real requests, because the bot is working and tested in according lib.

Testing UI is difficult, maybe add https://github.com/FluentLenium/FluentLenium

Testing plugin api is difficult, don't know how to implement. Look into org.jetbrains.teamcity:tests-support (maybe bump version)
Examples: https://github.com/browserstack/teamcity-plugin/blob/master/browserstack-teamcity-server/src/test/java/com/browserstack/automate/ci/teamcity/AutomateBuildFeatureTest.java

https://github.com/jonnyzzz/TeamCity.Node/blob/master/tests/src/test/java/NVMDownloadTest.java

Improve bot messages (send chatid only on /getid

these lines reply on every message with chatid

private void addUpdatesListener(TelegramBot bot) {
bot.setUpdatesListener(updates -> {
for (Update update : updates) {
Message message = update.message();
Long chatId = message.chat().id();
SendMessage msg = new SendMessage(chatId,
"Hello! Your chat id is '" + chatId + "'.\n" +
"If you want to receive notifications about Teamcity events " +
"please add this chat id in your Teamcity settings");
bot.execute(msg);
}
return UpdatesListener.CONFIRMED_UPDATES_ALL;
});
}

add /getid method and add instruction to readme about adding this method

or it should look like /help /getid

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.