Compare commits
9 Commits
10c069e999
...
f369cb65bf
Author | SHA1 | Date |
---|---|---|
Fred Boniface | f369cb65bf | |
Fred Boniface | dd42127e16 | |
Fred Boniface | 018a387e54 | |
Fred Boniface | 3751b69a19 | |
Fred Boniface | a8bcfbba61 | |
Fred Boniface | c70c7637a3 | |
Fred Boniface | f2f0d33e61 | |
Fred Boniface | 9d4808d64f | |
Fred Boniface | b93e4bf1be |
|
@ -0,0 +1,41 @@
|
||||||
|
<?php
|
||||||
|
// Get API Key for git.fjla.uk
|
||||||
|
$giteaKey = "Authorization: token d9e748bbca7b662dbd946854e57ae0213d0e8f88";
|
||||||
|
|
||||||
|
echo "Gitea AUTH header is: $giteaKey";
|
||||||
|
|
||||||
|
// Set httpHeaders
|
||||||
|
$httpHeaders = array(
|
||||||
|
"accept: application/json",
|
||||||
|
$giteaKey,
|
||||||
|
"Content-Type: application/json"
|
||||||
|
);
|
||||||
|
|
||||||
|
// Prepare $detail to POST
|
||||||
|
$body = "This is a PHP-CLI test issue.";
|
||||||
|
$subject = "Test Issue";
|
||||||
|
|
||||||
|
echo "Prepared POST data:\nSubject: $subject\nBody:$body";
|
||||||
|
|
||||||
|
// Prepare the request
|
||||||
|
$rawData = array(
|
||||||
|
'body' => $body,
|
||||||
|
'title' => $subject
|
||||||
|
);
|
||||||
|
|
||||||
|
$issueData = json_encode($rawData);
|
||||||
|
|
||||||
|
echo "Ready to send data:\n$issueData";
|
||||||
|
|
||||||
|
// Prepare CURL
|
||||||
|
$curlConnection = curl_init('https://git.fjla.uk/api/v1/repos/fred.boniface/athena.fb-infra.uk/issues');
|
||||||
|
curl_setopt($curlConnection, CURLOPT_POSTFIELDS, $issueData);
|
||||||
|
curl_setopt($curlConnection, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($curlConnection, CURLOPT_HTTPHEADER, $httpHeaders);
|
||||||
|
|
||||||
|
// Get response and exit CURL
|
||||||
|
$giteaResponse = curl_exec($curlConnection);
|
||||||
|
curl_close($curlConnection);
|
||||||
|
|
||||||
|
echo "Response: " . $giteaResponse;
|
||||||
|
?>
|
|
@ -1,5 +1,3 @@
|
||||||
<?php
|
<?php
|
||||||
$athenaVersion = '0.4.0-devel';
|
$athenaVersion = '0.4.0-devel';
|
||||||
$athenaVersionInt = 40;
|
|
||||||
$athenaVersionDescript = 'devel';
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -46,8 +46,7 @@
|
||||||
// Prepare the request
|
// Prepare the request
|
||||||
$rawData = array(
|
$rawData = array(
|
||||||
'body' => $body,
|
'body' => $body,
|
||||||
'title' => $subject,
|
'title' => $subject
|
||||||
'closed' => 'false'
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$issueData = json_encode($rawData);
|
$issueData = json_encode($rawData);
|
||||||
|
|
Reference in New Issue