I am new to Slack . I created a team and I added integration with our SVN repository. I have installed a "post-commit" script, and I am notified in the alleged Slack channel. Everything is as good as possible.
I would like to set up a notification on the slack channel, and I am failing.
Post-commit script based on Perl; several templates are available. I used one and added a line to include files modified in this way:
my $files = `/usr/bin/svnlook changed -r $ARGV[1] $ARGV[0]`;
my $date = `/usr/bin/svnlook date -r $ARGV[1] $ARGV[0]`;
my $log = `/usr/bin/svnlook log -r $ARGV[1] $ARGV[0]`;
my $who = `/usr/bin/svnlook author -r $ARGV[1] $ARGV[0]`;
chomp $who;
my $payload = {
'revision' => $ARGV[1],
'date' => $date,
'author' => $who,
'log' => $log,
'files' => $files,
};
my $ua = LWP::UserAgent->new;
$ua->timeout(15);
my $req = POST( "https://${opt_domain}/services/hooks/subversion?token=${opt_token}", ['payload' => encode_json($payload)] );
The only message I get on the Slack channel is:
<rev number>:<author>-<log message>
, , , , Slack. svnlook . script :
my $payload = {
'wibble' => $ARGV[1],
'date' => $date,
'author' => $who,
'log' => $log,
'files' => $files,
};
hook
post-commit /var/svn/repo 5966
() , :
payload=%7B%22wibble%22%3A%225966%22
( /),
Response:
HTTP/1.1 500 Server Error
Connection: close
...
X-Cache: Error from cloudfront
X-Frame-Options: SAMEORIGIN
invalid_payload
, , :
revision: 5696
date: 2016/03/14 12:00:00
author: ...
log: <log text>
files: myfile.c, myfile.h
,
wibble: 5696
, , - Slack JSON, . , NO , . , , , , , Slack?