feat: add dockerfile location

This commit is contained in:
Andras Bacsai
2023-10-10 14:02:43 +02:00
parent 24fa56762e
commit 0be8ffbdc9
5 changed files with 94 additions and 4 deletions

View File

@@ -101,7 +101,21 @@ class Application extends BaseModel
}
);
}
public function dockerfileLocation(): Attribute
{
return Attribute::make(
set: function ($value) {
if (is_null($value) || $value === '') {
return '/Dockerfile';
} else {
if ($value !== '/') {
return Str::start(Str::replaceEnd('/', '', $value), '/');
}
return Str::start($value, '/');
}
}
);
}
public function baseDirectory(): Attribute
{
return Attribute::make(
@@ -259,14 +273,14 @@ class Application extends BaseModel
if ($this->dockerfile) {
return false;
}
if ($this->build_pack === 'dockerimage'){
if ($this->build_pack === 'dockerimage') {
return false;
}
return true;
}
public function isHealthcheckDisabled(): bool
{
if (data_get($this, 'dockerfile') || data_get($this, 'build_pack') === 'dockerfile' || data_get($this, 'health_check_enabled') === false) {
if (data_get($this, 'health_check_enabled') === false) {
return true;
}
return false;