https://github.com/maxmind/teamcity-message
Generate TeamCity build messages
https://github.com/maxmind/teamcity-message
Last synced: 8 months ago
JSON representation
Generate TeamCity build messages
- Host: GitHub
- URL: https://github.com/maxmind/teamcity-message
- Owner: maxmind
- License: other
- Created: 2016-04-20T17:22:26.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2025-02-14T20:22:24.000Z (over 1 year ago)
- Last Synced: 2025-02-14T21:28:45.651Z (over 1 year ago)
- Language: Perl
- Homepage: https://metacpan.org/release/TeamCity-Message/
- Size: 29.3 KB
- Stars: 1
- Watchers: 14
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# NAME
TeamCity::Message - Generate TeamCity build messages
# VERSION
version 0.02
# SYNOPSIS
use TeamCity::Message;
print STDOUT tc_message(
type => 'message',
content => { text => 'This is a build message.' },
);
print STDOUT tc_message(
type => 'message',
content => {
text => 'This is a serious build message.',
status => 'ERROR',
},
);
print STDOUT tc_message(
type => 'progressMessage',
content => 'This is a progress message',
);
# DESCRIPTION
This module generates TeamCity build messages.
See
[https://confluence.jetbrains.com/display/TCD9/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-reportingMessagesForBuildLogReportingMessagesForBuildLog](https://confluence.jetbrains.com/display/TCD9/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-reportingMessagesForBuildLogReportingMessagesForBuildLog)
for more details on TeamCity build messages.
# API
## tc\_message(...)
Exported by default, this subroutine can be used to generate properly formatted
and escaped TeamCity build message.
This subroutine accepts the following arguments:
- type
This is the message type, such as "message", "testStarted", "testFinished",
etc.
This is required.
- content
This can be either a string or a hash reference of key/value pairs. This will
be turned into the content of the message.
This is required.
When the `content` parameter is a hash reference, this subroutine will always
add a "timestamp" to the message matching the current time. You can provide an
explicit `timestamp` value in the `content` if you want to set this
yourself.
## tc\_timestamp()
Exported on demand, this subroutine will return a string containing the current
timestamp formatted suitably for consumption by TeamCity. You can pass this
to the `tc_message(...)` function like so:
my $remembered_timestamp = tc_timestamp();
# ...time passes...
print STDOUT tc_message(
type => 'message',
content => {
text => 'This is a build message.',
timestamp => $remembered_timestamp,
}
);
# SUPPORT
Please report all issues with this code using the GitHub issue tracker at
[https://github.com/maxmind/TeamCity-Message/issues](https://github.com/maxmind/TeamCity-Message/issues).
Bugs may be submitted through [https://github.com/maxmind/TeamCity-Message/issues](https://github.com/maxmind/TeamCity-Message/issues).
# AUTHOR
Dave Rolsky
# CONTRIBUTORS
- Dave Rolsky
- Mark Fowler
# COPYRIGHT AND LICENSE
This software is Copyright (c) 2017 by MaxMind, Inc..
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)