mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-14 17:29:46 +08:00
Read raw data and add a submit-build.sh test script
Signed-off-by: Petr Šabata <contyk@redhat.com>
This commit is contained in:
2
rida.py
2
rida.py
@@ -62,7 +62,7 @@ def submit_build():
|
||||
" new build", 403)
|
||||
|
||||
try:
|
||||
r = json.loads(request.data.decode('utf-8'))
|
||||
r = json.loads(request.get_data().decode("utf-8"))
|
||||
except:
|
||||
return "Invalid JSON submitted", 400
|
||||
if "scmurl" not in r:
|
||||
|
||||
3
submit-build.json
Normal file
3
submit-build.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"scmurl": "git://pkgs.stg.fedoraproject.org/modules/testmodule.git?#020ea37251df5019fde9e7899d2f7d7a987dfbf5"
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
""" A little script to test submitting a build. """
|
||||
|
||||
import requests
|
||||
|
||||
response = requests.post('http://127.0.0.1:5000/rida/module-builds/', json={
|
||||
'scmurl': 'git://pkgs.stg.fedoraproject.org/modules/core.git',
|
||||
})
|
||||
|
||||
print("%r %s" % (response, response.text))
|
||||
5
submit-build.sh
Executable file
5
submit-build.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
echo "Submmiting a build of modules/testmodule, #020ea37251df5019fde9e7899d2f7d7a987dfbf5"
|
||||
echo "Using https://localhost:5000/rida/module-builds/"
|
||||
echo "NOTE: You need to be a Fedora packager for this to work"
|
||||
curl --cert ~/.fedora.cert -k -H "Content-Type: text/json" --data @submit-build.json https://localhost:5000/rida/module-builds/
|
||||
Reference in New Issue
Block a user