add custom git commit deployment
This commit is contained in:
@@ -44,16 +44,23 @@ class Application extends BaseModel
|
||||
set: fn ($value) => $value ? '/' . ltrim($value, '/') : null,
|
||||
);
|
||||
}
|
||||
public function gitLocation(): Attribute
|
||||
public function gitBranchLocation(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function () {
|
||||
if (!is_null($this->source?->html_url) && !is_null($this->git_repository) && !is_null($this->git_branch)) {
|
||||
if (is_null($this->git_commit_sha)) {
|
||||
return "{$this->source->html_url}/{$this->git_repository}/tree/{$this->git_branch}";
|
||||
} else {
|
||||
return "{$this->source->html_url}/{$this->git_repository}/tree/{$this->git_commit_sha}";
|
||||
}
|
||||
return "{$this->source->html_url}/{$this->git_repository}/tree/{$this->git_branch}";
|
||||
}
|
||||
}
|
||||
|
||||
);
|
||||
}
|
||||
public function gitCommits(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function () {
|
||||
if (!is_null($this->source?->html_url) && !is_null($this->git_repository) && !is_null($this->git_branch)) {
|
||||
return "{$this->source->html_url}/{$this->git_repository}/commits/{$this->git_branch}";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user