Skip to content

Commit

Permalink
feat: #228 add extra worker
Browse files Browse the repository at this point in the history
  • Loading branch information
bohdan-shulha committed Oct 15, 2024
1 parent 32f3bfa commit 02b349d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ jobs:
workers:
- name: main
dockerImage: ghcr.io/ptah-sh/ptah-server:${{ needs.release-please.outputs.tag_name }}
- name: scheduler
- name: schedule_root
dockerImage: ghcr.io/ptah-sh/ptah-server:${{ needs.release-please.outputs.tag_name }}
- name: schedule_run
dockerImage: ghcr.io/ptah-sh/ptah-server:${{ needs.release-please.outputs.tag_name }}
- name: queue
dockerImage: ghcr.io/ptah-sh/ptah-server:${{ needs.release-please.outputs.tag_name }}
Expand Down
6 changes: 6 additions & 0 deletions app/Models/DeploymentData/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,12 @@ public function copyWith(array $attributes): static

if (isset($attributes['workers'])) {
foreach ($attributes['workers'] as $idx => $worker) {
if (! isset($worker['name'])) {
$errors["workers.{$idx}.name"] = 'Worker name is required';

continue;
}

if (! $this->findWorkerByName($worker['name'])) {
$errors["workers.{$idx}.name"] = 'Worker '.$worker['name'].' does not exist';
}
Expand Down
2 changes: 1 addition & 1 deletion app/Policies/ServicePolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ public function forceDelete(User $user, Service $service): bool

public function deploy(User $user, Service $service): bool
{
return $user->belongsToTeam($service->team) && $service->team->hasValidSubscription();
return $user->belongsToTeam($service->team) && ($service->team->hasValidSubscription() || $service->team->onTrial());
}
}

0 comments on commit 02b349d

Please sign in to comment.