tag
Some checks failed
Build and Deploy to k3s / build-and-deploy (push) Failing after 31s

This commit is contained in:
Alexis Bruneteau 2025-06-05 06:13:53 +02:00
parent a01337425c
commit efac8e346b

View File

@ -14,16 +14,16 @@ class DeployStaticSite extends Command
public function handle()
{
$name = $this->argument('name');
$host = $this->argument('host');
$id = $this->argument('id');
$host = $this->argument('host');
$id = $this->argument('id');
$namespace = 'hosting-deploy';
$kubeDir = storage_path("app/kube/{$name}");
File::ensureDirectoryExists($kubeDir);
// 1. Generate K8s YAMLs
File::put("{$kubeDir}/deployment.yaml", $this->deployment($name,$id, $namespace));
File::put("{$kubeDir}/service.yaml", $this->service($name,$id, $namespace));
File::put("{$kubeDir}/ingress.yaml", $this->ingress($name,$host,$id, $namespace));
File::put("{$kubeDir}/deployment.yaml", $this->deployment($name, $id, $namespace));
File::put("{$kubeDir}/service.yaml", $this->service($name, $id, $namespace));
File::put("{$kubeDir}/ingress.yaml", $this->ingress($name, $host, $id, $namespace));
$this->info("✅ K8s manifests generated.");
@ -38,7 +38,6 @@ class DeployStaticSite extends Command
'--extra-vars', "siteid={$id}"
],
null, // cwd
['HOME' => '/tmp'] // env vars
);
$process->setTimeout(300);
$process->run(function ($type, $buffer) {
@ -52,7 +51,7 @@ class DeployStaticSite extends Command
}
}
private function deployment(string $name,string $id, string $namespace): string
private function deployment(string $name, string $id, string $namespace): string
{
return <<<YAML
apiVersion: apps/v1
@ -107,7 +106,7 @@ spec:
YAML;
}
private function ingress(string $name,string $host,string $id, string $namespace): string
private function ingress(string $name, string $host, string $id, string $namespace): string
{
return <<<YAML
apiVersion: networking.k8s.io/v1