Giter Club home page Giter Club logo

teamcity-messages's Introduction

TeamCity Messages

This PHP library simplifies formatting and writing TeamCity service messages.

Build Status Coverage Status

Installation

To add TeamcityMessages as a local, per-project dependency to your project, simply add a dependency on michal-kocarek/teamcity-messages to your project's composer.json file. Here is a minimal example of a composer.json file that just defines a dependency on TeamcityMessages:

{
    "require": {
        "michal-kocarek/teamcity-messages": "^1.2"
    }
}

Usage

Here's the basic example. MessageLogger instance dumps everything through the writer.

StdOutWriter echoes output directly to script standard output. (You may use CallbackWriter to pass messages to arbitrary callback.)

Code like this:

use MichalKocarek\TeamcityMessages\MessageLogger;
use MichalKocarek\TeamcityMessages\Writers\StdoutWriter;

$logger = new MessageLogger(new StdoutWriter());

$logger->progressMessage('Reticulating splines...');

$logger->block('Counting llamas...', null, function(MessageLogger $logger) {
    $logger->logWarning('Too many llamas!');
    $logger->publishArtifacts('logs/llamas-count.csv');
});

produces following output:

##teamcity[progressMessage timestamp='2016-03-16T23:29:37.120555+0000' message='Reticulating splines...']
##teamcity[blockOpened timestamp='2016-03-16T23:29:37.134303+0000' name='Counting llamas...']
##teamcity[message timestamp='2016-03-16T23:29:37.134535+0000' text='Too many llamas!' status='WARNING']
##teamcity[publishArtifacts timestamp='2016-03-16T23:29:37.134635+0000' path='logs/llamas-count.csv']
##teamcity[blockClosed timestamp='2016-03-16T23:29:37.134993+0000' name='Counting llamas...']

See MessageLogger public methods for more info about the usage and link below for detailed message specification.

Links

Authors

Michal Kočárek [email protected] - https://twitter.com/michalkocarek

License

This library is licensed under the MIT License – see the LICENSE file for details.

teamcity-messages's People

Stargazers

Denis Smet avatar Honza Lilák avatar

Forkers

smetdenis

teamcity-messages's Issues

Support old PHP versions

Hi,

Very nice tool, thanks!

Why did you set php version >=5.6 ?
I would like to use your package for our project, and we need to check code in php 5.4+...7.0 and hhvm via teamciy.
Is there some special features? I think you can change it to >=5.4 without any problems and check it on travis.

What do you think?

Thanks and best regards, Denis.

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.