]> git.xonotic.org Git - xonotic/xonotic.git/blob - misc/tools/redmine-create-issue.sh
Restore yet another weird path in SDL lib configs
[xonotic/xonotic.git] / misc / tools / redmine-create-issue.sh
1 #!/bin/bash
2
3 # Begin config
4
5 STATUS_ID=${STATUS_ID:-1}
6 PROJECT_ID=${PROJECT_ID:-8}
7 TRACKER_ID=${TRACKER_ID:-4}
8 PRIORITY_ID=${PRIORITY_ID:-4}
9 REDMINE_URL=${REDMINE_URL:-"http://dev.xonotic.org"}
10
11 # End config
12
13 if [ "$#" -ne "4" ];
14 then
15         echo "Usage: $0 <user> <pass> <subject> <description>"
16         exit;
17 fi;
18
19 USER="$1"
20 PASS="$2"
21 SUBJECT="$3"
22 DESCRIPTION=$(echo "$4" | sed -e 's/</\&lt;/g;s/>/\&gt;/g')
23
24 cat > CONTENTS <<EOF
25 <?xml version="1.0"?>
26 <issue>
27         <status_id>${STATUS_ID}</status_id>
28         <tracker_id>${TRACKER_ID}</tracker_id>
29         <project_id>${PROJECT_ID}</project_id>
30         <priority_id>${PRIORITY_ID}</priority_id>
31         <subject>${SUBJECT}</subject>
32         <description>${DESCRIPTION}</description>
33         <notes></notes>
34 </issue>
35 EOF
36
37 curl -X POST -H "Content-Type:application/xml" --data "@CONTENTS" -u "${USER}:${PASS}" "${REDMINE_URL}/issues.xml" > /dev/null
38
39 rm CONTENTS
40