diff --git a/indefero/scripts/SyncMercurial.sh b/indefero/scripts/SyncMercurial.sh new file mode 100644 index 0000000..54ee937 --- /dev/null +++ b/indefero/scripts/SyncMercurial.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +private_notify="/home/mercurial/tmp/notify.tmp" +# reload_cmd="/usr/sbin/apachectl -k graceful" +reload_cmd="sudo /etc/init.d/apache2 reload" + +if [ -e $private_notify ]; then + rm -f $private_notify + $reload_cmd +fi + diff --git a/indefero/scripts/activitycron.php b/indefero/scripts/activitycron.php new file mode 100644 index 0000000..43f91d9 --- /dev/null +++ b/indefero/scripts/activitycron.php @@ -0,0 +1,48 @@ + 1) { + $date = new DateTime($_SERVER['argv'][1]); +} + +echo 'recalculating project activity for '.$date->format('Y-m-d')."\n"; +IDF_ActivityTaxonomy::recalculateTaxnomies($date); + diff --git a/indefero/scripts/git-post-update b/indefero/scripts/git-post-update new file mode 100644 index 0000000..f1b2b73 --- /dev/null +++ b/indefero/scripts/git-post-update @@ -0,0 +1,24 @@ +#!/bin/sh +# +# This hook does only one thing: +# +# 1. It calls the gitpostupdate.php script with the current $GIT_DIR +# as argument. The gitpostupdate.php script will then trigger +# the 'gitpostupdate.php::run' event with the $GIT_DIR as argument +# together with merged $_ENV and $_SERVER array. +# +# This hook is normally installed automatically at the creation of your +# repository if you have everything configured correctly. If you want +# to enable it later, you need to symlink it as "post-update" in your +# $GIT_DIR/hooks folder. +# +# www$ chmod +x /home/www/indefero/scripts/git-post-update +# git$ cd /home/git/repositories/project.git/hooks +# git$ ln -s /home/www/indefero/scripts/git-post-update post-update +# + +SCRIPTDIR=$(dirname $(readlink $0)) +FULL_GIT_DIR=$(cd "$GIT_DIR" && /bin/pwd || "$GIT_DIR") +PHP_POST_UPDATE=$SCRIPTDIR/gitpostupdate.php + +echo php $PHP_POST_UPDATE $FULL_GIT_DIR | at now > /dev/null 2>&1 diff --git a/indefero/scripts/gitcron.php b/indefero/scripts/gitcron.php new file mode 100644 index 0000000..32587c8 --- /dev/null +++ b/indefero/scripts/gitcron.php @@ -0,0 +1,35 @@ + '/path/to/git/repository.git', + * 'env' => array_merge($_ENV, $_SERVER)); + * + */ +$params = array('git_dir' => $argv[1], + 'env' => array_merge($_ENV, $_SERVER)); +Pluf_Log::event(array('gitpostupdate.php', 'Send run signal.', $params)); +Pluf_Signal::send('gitpostupdate.php::run', 'gitpostupdate.php', $params); + + diff --git a/indefero/scripts/gitserve.php b/indefero/scripts/gitserve.php new file mode 100644 index 0000000..7bcd124 --- /dev/null +++ b/indefero/scripts/gitserve.php @@ -0,0 +1,36 @@ + '/relative/path/to/hg/repository', + * 'env' => array_merge($_ENV, $_SERVER)); + * + */ +#$params = array('rel_dir' => $_ENV['PATH_INFO'], +# 'env' => array_merge($_ENV, $_SERVER)); +$params = array('rel_dir' => '/home/mercurial/repositories', + 'env' => array_merge($_ENV, $_SERVER)); + +Pluf_Signal::send('hgchangegroup.php::run', 'hgchangegroup.php', $params); + + diff --git a/indefero/scripts/hgweb.cgi b/indefero/scripts/hgweb.cgi new file mode 100644 index 0000000..f81a935 --- /dev/null +++ b/indefero/scripts/hgweb.cgi @@ -0,0 +1,20 @@ +#!/usr/bin/env python +# +# An example hgweb CGI script, edit as necessary +# See also http://mercurial.selenic.com/wiki/PublishingRepositories + +# Path to repo or hgweb config to serve (see 'hg help hgweb') +# config = "/path/to/repo/or/config" +config = "/home/www/indefero/scripts/hgweb.config" + +# Uncomment and adjust if Mercurial is not installed system-wide +# (consult "installed modules" path from 'hg debuginstall'): +#import sys; sys.path.insert(0, "/path/to/python/lib") + +# Uncomment to send python tracebacks to the browser if an error occurs: +#import cgitb; cgitb.enable() + +from mercurial import demandimport; demandimport.enable() +from mercurial.hgweb import hgwebdir, wsgicgi +application = hgwebdir(config) +wsgicgi.launch(application) diff --git a/indefero/scripts/hgweb.cgi.old b/indefero/scripts/hgweb.cgi.old new file mode 100644 index 0000000..0a806f0 --- /dev/null +++ b/indefero/scripts/hgweb.cgi.old @@ -0,0 +1,127 @@ + + + + + + + + +Mercurial (stable branch): 04eb7d7e115b hgweb.cgi + + + +
+ + +
+ +

view hgweb.cgi @ 19161:04eb7d7e115b

+ + + +
Added signature for changeset cceaf7af4c9e
+ + + + + + + + + + + + + + + + + + + +
authorMatt Mackall <mpm@selenic.com>
dateSat, 01 Jun 2013 17:10:24 -0500
parents227b9f13db13
children
+ +
+
line source
+ +
1 #!/usr/bin/env python +
+
2 # +
+
3 # An example hgweb CGI script, edit as necessary +
+
4 # See also http://mercurial.selenic.com/wiki/PublishingRepositories +
+
5 +
+
6 # Path to repo or hgweb config to serve (see 'hg help hgweb') +
+
7 config = "/path/to/repo/or/config" +
+
8 +
+
9 # Uncomment and adjust if Mercurial is not installed system-wide +
+
10 # (consult "installed modules" path from 'hg debuginstall'): +
+
11 #import sys; sys.path.insert(0, "/path/to/python/lib") +
+
12 +
+
13 # Uncomment to send python tracebacks to the browser if an error occurs: +
+
14 #import cgitb; cgitb.enable() +
+
15 +
+
16 from mercurial import demandimport; demandimport.enable() +
+
17 from mercurial.hgweb import hgweb, wsgicgi +
+
18 application = hgweb(config) +
+
19 wsgicgi.launch(application) +
+
+
+
+
+ + + + + + + diff --git a/indefero/scripts/hgweb.config b/indefero/scripts/hgweb.config new file mode 100644 index 0000000..eeb1f0e --- /dev/null +++ b/indefero/scripts/hgweb.config @@ -0,0 +1,2 @@ +[collections] +/home/mercurial/repositories = /home/mercurial/repositories diff --git a/indefero/scripts/mtn-post-push b/indefero/scripts/mtn-post-push new file mode 100644 index 0000000..e41b41f --- /dev/null +++ b/indefero/scripts/mtn-post-push @@ -0,0 +1,22 @@ +#!/bin/sh +# +# This hook informs IDF that new revisions arrived in the database +# of the specified project. +# +# This hook is normally installed automatically at the creation of your +# repository if you have everything configured correctly. If you want +# to enable it later, you need to call it into your monotonerc file +# from the hook "note_netsync_end". (See chapter "Event Notifications +# and Triggers" on .) +# + +dir=$(dirname "$0") +res=$(cd "$dir" && /bin/pwd || "$dir") +SCRIPTDIR="$res/$(readlink $0)" +PHP_POST_PUSH=$SCRIPTDIR/mtnpostpush.php + +TMPFILE=$(mktemp /tmp/mtn-post-push.XXXXXX) || exit 1 +while read rev; do echo $rev >> $TMPFILE; done + +echo php $PHP_POST_PUSH "$1" \< $TMPFILE \&\& rm -f $TMPFILE |\ + at now > /dev/null 2>&1 diff --git a/indefero/scripts/mtnpostpush.php b/indefero/scripts/mtnpostpush.php new file mode 100644 index 0000000..bae9d3f --- /dev/null +++ b/indefero/scripts/mtnpostpush.php @@ -0,0 +1,63 @@ + 'name-of-the-project', + * 'revisions' => array('123abc...', '456def...', ...)); + * + */ + +fwrite(STDERR, "waiting for revisions on STDIN...\n"); +$stdin = file_get_contents('php://stdin'); + +$params = array('project' => $argv[1], + 'revisions' => explode("\n", chop($stdin))); +Pluf_Signal::send('mtnpostpush.php::run', 'mtnpostpush.php', $params); + + + diff --git a/indefero/scripts/private_indefero.conf b/indefero/scripts/private_indefero.conf new file mode 100644 index 0000000..e69de29 diff --git a/indefero/scripts/queuecron.php b/indefero/scripts/queuecron.php new file mode 100644 index 0000000..7539eef --- /dev/null +++ b/indefero/scripts/queuecron.php @@ -0,0 +1,69 @@ + /dev/null 2>&1 diff --git a/indefero/scripts/svn-post-revprop-change b/indefero/scripts/svn-post-revprop-change new file mode 100644 index 0000000..97b9283 --- /dev/null +++ b/indefero/scripts/svn-post-revprop-change @@ -0,0 +1,29 @@ +#!/bin/sh +# +# This hook does only one thing: +# +# 1. It calls the svnpostrevpropchange.php script with the current repository +# and revision as argument. The svnpostrevpropchange.php script will then +# trigger the 'svnpostrevpropchange.php::run' event with the repository +# path, revision, username, property name and action as arguments together +# with merged $_ENV and $_SERVER array. +# +# This hook is normally installed automatically at the creation of your +# repository if you have everything configured correctly. If you want +# to enable it later, you need to symlink it as "post-revprop-change" in your +# $REPOSITORY/hooks folder. It needs to be executable. +# +# www$ chmod +x /home/www/indefero/scripts/svn-post-revprop-change +# www$ cd /home/svn/repositories/project/hooks +# www$ ln -s /home/www/indefero/scripts/svn-post-revprop-change post-revprop-change +# + +SCRIPTDIR=$(dirname $(readlink $0)) +PHP_POST_REVPROP=$SCRIPTDIR/svnpostrevpropchange.php + +echo php $PHP_POST_REVPROP "$1" "$2" "$3" "$4" "$5" | at now > /dev/null 2>&1 +REPOS="$1" +REV="$2" +USER="$3" +PROPNAME="$4" +ACTION="$5" diff --git a/indefero/scripts/svnpostcommit.php b/indefero/scripts/svnpostcommit.php new file mode 100644 index 0000000..d118288 --- /dev/null +++ b/indefero/scripts/svnpostcommit.php @@ -0,0 +1,62 @@ + '/path/to/subversion/repository', + * 'revision' => 1234, + * 'env' => array_merge($_ENV, $_SERVER)); + * + */ +$params = array('repo_dir' => $argv[1], + 'revision' => $argv[2], + 'env' => array_merge($_ENV, $_SERVER)); +Pluf_Log::event(array('svnpostcommit.php', 'Send run signal.', $params)); +Pluf_Signal::send('svnpostcommit.php::run', 'svnpostcommit.php', $params); + + + diff --git a/indefero/scripts/svnpostrevpropchange.php b/indefero/scripts/svnpostrevpropchange.php new file mode 100644 index 0000000..5e1687d --- /dev/null +++ b/indefero/scripts/svnpostrevpropchange.php @@ -0,0 +1,70 @@ + '/path/to/subversion/repository', + * 'revision' => 1234, + * 'user' => 'username', + * 'propname' => 'changed-property', + * 'action' => 'the action M, A or D', + * 'env' => array_merge($_ENV, $_SERVER)); + * + */ + +$params = array('repo_dir' => $argv[1], + 'revision' => $argv[2], + 'user' => $argv[3], + 'propname' => $argv[4], + 'action' => $argv[5], + 'env' => array_merge($_ENV, $_SERVER)); +Pluf_Signal::send('svnpostrevpropchange.php::run', 'svnpostrevpropchange.php', + $params); + + +