fix: do not overlap docker image names

This commit is contained in:
Andras Bacsai 2023-07-06 14:19:50 +02:00
parent ef0393bed6
commit 81fee02e8f

View File

@ -153,8 +153,13 @@ private function deploy()
$this->prepare_builder_image();
$this->clone_repository();
$this->build_image_name = "{$this->application->git_repository}:{$this->commit}-build";
$this->production_image_name = "{$this->application->uuid}:{$this->commit}";
$tag = Str::of("{$this->commit}-{$this->application->id}-{$this->pull_request_id}");
if ($tag->count() > 128) {
$tag = $tag->substr(0, 128);
};
$this->build_image_name = "{$this->application->git_repository}:{$tag}-build";
$this->production_image_name = "{$this->application->uuid}:{$tag}";
ray('Build Image Name: ' . $this->build_image_name . ' & Production Image Name: ' . $this->production_image_name)->green();
if (!$this->force_rebuild) {