Automatic import of new changesets with source-integration

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
dmarechal
Posts: 7
Joined: 23 Nov 2016, 15:30
Location: France

Automatic import of new changesets with source-integration

Post by dmarechal »

Hi, I have successfully integrated SVN/WebSVN with MantisBT 2.7.0 using source-integration plugin (found here https://github.com/mantisbt-plugins/source-integration).

My only problem is at the last step, when I have to use a cron job on web server to automate the import of new changesets.

Code: Select all

php-cgi -f plugin.php page=Source/import id=all api_key=<YOUR_API_KEY>
I have no idea in which file to put this code, or how to configure a cron job. Is it something easily doable, or does it take several steps?
I would really appreciate some help

Thanks
Attachments
server.png
server.png (16.83 KiB) Viewed 2934 times
plugins.png
plugins.png (91.55 KiB) Viewed 2934 times
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Automatic import of new changesets with source-integrati

Post by atrol »

Please use Search before posting and read the Manual
dmarechal
Posts: 7
Joined: 23 Nov 2016, 15:30
Location: France

Re: Automatic import of new changesets with source-integrati

Post by dmarechal »

Thank you for your answer

The command has to be executed when a commit is performed in SVN, not at a scheduled time.
So I guessed it has to be related to SVN hooks; I checked in SourceWebSVN extension plugin and found post-commit.tmpl which contains the following code:

Code: Select all

#!/bin/sh

# Copyright (c) 2012 John Reese
# Licensed under the MIT license

REV="$2"

URL="http://localhost/mantisbt/plugin.php?page=Source/checkin"
PROJECT="Repository Name"

LOG_FILE=`mktemp /tmp/svn_${PROJECT}_${REV}_log.XXX`

CURL=/usr/bin/curl

${CURL} -d "repo_name=${PROJECT}" -d "data=${REV}" ${URL} >> ${LOG_FILE}
In the github page of source-integration plugin, they also talk about curl
import via curl (could run into timeouts on large repositories, or block your webserver)
and propose the following code:

Code: Select all

curl "http://host.domain.tld/mantisbt/plugin.php?page=Source/import&id=all&api_key=<YOUR_API_KEY>"
I'm going to try it out tomorrow at work and let you know

Edit: I could not manage to make it work, so I give up for now
Post Reply