Fixed update Redmine script.
This commit is contained in:
parent
dd90151005
commit
8d494feb91
28
rapport_activite/update_redmine_ticket.sh
Executable file
28
rapport_activite/update_redmine_ticket.sh
Executable file
@ -0,0 +1,28 @@
|
||||
#! /bin/bash
|
||||
|
||||
source "/etc/visio.chapril.org/visiochaprilorg.conf"
|
||||
source "/etc/chagirbot/agiraprilorg.conf"
|
||||
REDMINE_API_KEY="$key"
|
||||
|
||||
#
|
||||
post_report()
|
||||
{
|
||||
datafile=$(mktemp /tmp/report_stats_$(date +%Y-%m-%d_%H%M)_XXXX.json)
|
||||
cat <<EOF > "${datafile}"
|
||||
{
|
||||
"issue": {
|
||||
"notes": "$(/srv/visio.chapril.org/tools/rapport_activite/rapport_activite.sh -p | sed -z 's/\n/\\n/g')"
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
curl -s \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Redmine-API-Key: ${REDMINE_API_KEY}" \
|
||||
-X PUT --data-binary "@${datafile}" \
|
||||
"${REDMINE_BASE_URL}/issues/${REDMINE_TICKET_ID}.json"
|
||||
rm "${datafile}"
|
||||
}
|
||||
|
||||
# Main.
|
||||
post_report
|
Loading…
Reference in New Issue
Block a user