Archived
1
0
Fork 0
This commit is contained in:
Mercier Pierre-Olivier 2013-11-20 01:04:30 +01:00
parent 49e5dcddf4
commit 26f58dcaa6
7 changed files with 40 additions and 13 deletions

View file

@ -14,10 +14,10 @@ fi
if [ "x${1:0:2}" = "x20" ]
then
YEAR=" <param name=\"year\">$1</param>"
YEAR="$1"
shift
else
YEAR=
YEAR=`ldapsearch -x -b "cn=year,dc=acu,dc=epita,dc=fr" | grep "^year" | cut -d " " -f 2`
fi
PROJECT_ID=$1
RENDU=$2
@ -36,7 +36,7 @@ cat <<EOF | gearman -h gearmand -p 4730 -f moulette_get
<?xml version="1.0" encoding="UTF-8"?>
<process>
<param name="type">moulette</param>
$YEAR
<param name="year">$YEAR</param>
<param name="id">$PROJECT_ID</param>
<param name="rendu">$RENDU</param>
$LOGINS</process>

View file

@ -1,8 +1,13 @@
#!/bin/sh
if [ -z "$2" ]
usage()
{
echo "Usage: $0 [-d] [year] <project> <submission> <login> [login ...]"
}
if [ -z "$3" ]
then
echo "Usage: $0 [year] <project> <submission> [login ...]"
usage
exit 1
fi
@ -12,6 +17,14 @@ then
exit 1
fi
if [ "x$1" = "x-d" ]
then
BACKGROUD=
shift
else
BACKGROUD="-b"
fi
if [ "x${1:0:2}" = "x20" ]
then
YEAR=" <param name=\"year\">$1</param>"
@ -24,10 +37,16 @@ RENDU=$2
shift 2
if [ $# -le 0 ]
then
usage
exit 1
fi
while [ $# -gt 0 ]
do
LOGIN=$1
cat <<EOF | gearman -h gearmand -p 4730 -f send_git -b
cat <<EOF | gearman -h gearmand -p 4730 -f send_git $BACKGROUD
<?xml version="1.0"?>
<process>
$YEAR