22 lines
555 B
Bash
22 lines
555 B
Bash
#! /bin/bash
|
|
|
|
set -e
|
|
set -u
|
|
set -o pipefail
|
|
|
|
|
|
configFile=~/.gitapi
|
|
|
|
test -r $configFile || {
|
|
echo "gimme a $configFile with username, password and serverUrl correctly set"
|
|
exit 1
|
|
}
|
|
|
|
source $configFile
|
|
|
|
url=${server}/api/v1/
|
|
|
|
#curl -H "Authorization: Bearer ${token}" "${url}/repos/tom/Support/issues" -d '{"state": "close"}' -H 'Content-Type: application/json' -X GET
|
|
curl -H "Authorization: Bearer ${token}" "${url}/repos/tom/Support/issues" -X POST -d '{"title": "test"}' -H 'Content-Type: application/json'
|
|
|
|
[ $? -eq 0 ] && { echo issue created ; } |