feat: able to deploy docker images

This commit is contained in:
Andras Bacsai
2023-10-10 11:16:38 +02:00
parent 8abfaa1967
commit 14d9c06dcd
7 changed files with 66 additions and 27 deletions

View File

@@ -26,7 +26,11 @@ class DockerImage extends Component
'dockerImage' => 'required'
]);
$image = Str::of($this->dockerImage)->before(':');
$tag = Str::of($this->dockerImage)->after(':') ?: 'latest';
if (Str::of($this->dockerImage)->contains(':')) {
$tag = Str::of($this->dockerImage)->after(':');
} else {
$tag = 'latest';
}
$destination_uuid = $this->query['destination'];
$destination = StandaloneDocker::where('uuid', $destination_uuid)->first();
if (!$destination) {
@@ -39,6 +43,7 @@ class DockerImage extends Component
$project = Project::where('uuid', $this->parameters['project_uuid'])->first();
$environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first();
ray($image,$tag);
$application = Application::create([
'name' => 'docker-image-' . new Cuid2(7),
'repository_project_id' => 0,