1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Wulkanowy\BitriseRedirector\Controller; |
4
|
|
|
|
5
|
|
|
use InvalidArgumentException; |
6
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; |
7
|
|
|
use Symfony\Component\HttpFoundation\Response; |
8
|
|
|
|
9
|
|
|
class HomeController extends AbstractController |
10
|
|
|
{ |
11
|
|
|
/** |
12
|
|
|
* @throws InvalidArgumentException |
13
|
|
|
* |
14
|
|
|
* @return Response |
15
|
|
|
*/ |
16
|
|
|
public function index(): Response |
17
|
|
|
{ |
18
|
|
|
return new Response( |
19
|
|
|
<<<HTML |
20
|
|
|
<!DOCTYPE html> |
21
|
|
|
<title>Bitrise redirector</title> |
22
|
|
|
<h1>Bitrise redirector</h1> |
23
|
|
|
For more info go to |
24
|
|
|
<a href="https://github.com/wulkanowy/bitrise-redirector#bitrise-redirector">github page</a>. |
25
|
|
|
|
26
|
|
|
<ul> |
27
|
|
|
<li><code>GET |
28
|
|
|
<a href="{$this->generateUrl('branch', ['slug' => 'f841f20d8f8b1dc8'])}">/v0.1/apps/{slug}/builds/{branch}</a></code> |
29
|
|
|
– redirect to the latest build on a specific branch</li> |
30
|
|
|
<li><code>GET |
31
|
|
|
<a href="{$this->generateUrl('artifacts', ['slug' => 'f841f20d8f8b1dc8', 'branch' => 'master'])}">/v0.1/apps/{slug}/builds/{branch}/artifacts</a></code> |
32
|
|
|
– json list of build artifacts for the latest build on a specific branch</li> |
33
|
|
|
<li><code>GET |
34
|
|
|
<a href="{$this->generateUrl('artifactFilename', ['slug' => 'f841f20d8f8b1dc8', 'branch' => 'master', 'filename' => 'app-debug-bitrise-signed.apk'])}">/v0.1/apps/{slug}/builds/{branch}/artifacts/{filename}</a></code> |
35
|
|
|
– redirect to the download link of a specific build artifact</li> |
36
|
|
|
<li><code>GET |
37
|
|
|
<a href="{$this->generateUrl('artifactIndex', ['slug' => 'f841f20d8f8b1dc8', 'branch' => 'master', 'index' => '0'])}">/v0.1/apps/{slug}/builds/{branch}/artifacts/{index}</a></code> |
38
|
|
|
– redirect to the download link of a specific build artifact (index-based version)</li> |
39
|
|
|
<li><code>GET |
40
|
|
|
<a href="{$this->generateUrl('infoFilename', ['slug' => 'f841f20d8f8b1dc8', 'branch' => 'master', 'filename' => 'app-debug-bitrise-signed.apk'])}">/v0.1/apps/{slug}/builds/{branch}/artifacts/{filename}/info</a></code> |
41
|
|
|
– info of last artifact on specific branch</li> |
42
|
|
|
<li><code>GET |
43
|
|
|
<a href="{$this->generateUrl('infoIndex', ['slug' => 'f841f20d8f8b1dc8', 'branch' => 'master', 'index' => '0'])}">/v0.1/apps/{slug}/builds/{branch}/artifacts/{index}/info</a></code> |
44
|
|
|
– info of last artifact on specific branch (index-based version)</li> |
45
|
|
|
</ul> |
46
|
|
|
|
47
|
|
|
HTML |
48
|
|
|
); |
49
|
|
|
} |
50
|
|
|
} |
51
|
|
|
|