feat: tags and tag deploy webhooks

This commit is contained in:
Andras Bacsai
2024-02-01 15:38:12 +01:00
parent 44efe0b5e1
commit 6312c0ba84
20 changed files with 394 additions and 98 deletions

View File

@@ -110,9 +110,9 @@ function handleError(?Throwable $error = null, ?Livewire\Component $livewire = n
}
if ($error instanceof UniqueConstraintViolationException) {
if (isset($livewire)) {
return $livewire->dispatch('error', "A resource with the same name already exists.");
return $livewire->dispatch('error', "Duplicate entry found.","Please use a different name.");
}
return "A resource with the same name already exists.";
return "Duplicate entry found. Please use a different name.";
}
if ($error instanceof Throwable) {
@@ -481,7 +481,14 @@ function queryResourcesByUuid(string $uuid)
if ($mariadb) return $mariadb;
return $resource;
}
function generatTagDeployWebhook($tag_name)
{
$baseUrl = base_url();
$api = Url::fromString($baseUrl) . '/api/v1';
$endpoint = "/deploy/tag/$tag_name";
$url = $api . $endpoint . "?force=false";
return $url;
}
function generateDeployWebhook($resource)
{
$baseUrl = base_url();