qa: Update scripts
This commit is contained in:
parent
d2f409db7a
commit
d4990916b5
6 changed files with 77 additions and 24 deletions
24
qa-add-todo.sh
Executable file
24
qa-add-todo.sh
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
source qa-common.sh
|
||||
|
||||
TEAMNUM=$1
|
||||
THEMETODO=$2
|
||||
MIN_EXO_TODO=$3
|
||||
[ $# -gt 3 ] && MAX_EXO_TODO=$4 || MAX_EXO_TODO=$MIN_EXO_TODO
|
||||
MIN_EXO_TODO=$(($MIN_EXO_TODO - 1))
|
||||
|
||||
curl -s http://${HOST_FICADMIN}/api/teams | jq -r '.[] | [(.id | tostring), " ", .name] | add' | grep "${TEAM_PREFIX} ${TEAMNUM}" | while read TEAMID TEAMSTR
|
||||
do
|
||||
if echo $TEAMSTR | grep "${TEAM_PREFIX}" > /dev/null 2> /dev/null
|
||||
then
|
||||
GRPFIC=$(echo $TEAMSTR | sed -r "s/${TEAM_PREFIX} //")
|
||||
|
||||
curl -s http://${HOST_FICADMIN}/api/themes.json | jq -r '.["'$THEMETODO'"] | .exercices['$MIN_EXO_TODO:$MAX_EXO_TODO'] | .[].id' | while read EXID
|
||||
do
|
||||
curl -X POST -d @- -H "X-FIC-Team: ${QA_ADMIN}" http://${HOST_FICQA}/api/qa_work.json <<EOF
|
||||
{"id_team": $TEAMID, "id_exercice": $EXID}
|
||||
EOF
|
||||
done
|
||||
fi
|
||||
done
|
||||
Reference in a new issue