Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat(globe_cli): paused project handle for deploy and build log
fixup
  • Loading branch information
kaziwaseef committed Apr 2, 2024
commit 847ff1236f610a7250d7e56daa969c8aef70f4ec
19 changes: 19 additions & 0 deletions packages/globe_cli/lib/src/utils/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ class Project {
required this.id,
required this.orgId,
required this.slug,
required this.paused,
required this.createdAt,
required this.updatedAt,
});
Expand All @@ -442,13 +443,30 @@ class Project {
'id': final String id,
'organizationId': final String organizationId,
'slug': final String slug,
'paused': final bool paused,
'createdAt': final String createdAt,
'updatedAt': final String updatedAt,
} =>
Project._(
id: id,
orgId: organizationId,
slug: slug,
paused: paused,
createdAt: DateTime.parse(createdAt),
updatedAt: DateTime.parse(updatedAt),
),
{
'id': final String id,
'organizationId': final String organizationId,
'slug': final String slug,
'createdAt': final String createdAt,
'updatedAt': final String updatedAt,
} =>
Project._(
id: id,
orgId: organizationId,
slug: slug,
paused: false,
createdAt: DateTime.parse(createdAt),
updatedAt: DateTime.parse(updatedAt),
),
Expand All @@ -459,6 +477,7 @@ class Project {
final String id;
final String orgId;
final String slug;
final bool paused;
final DateTime createdAt;
final DateTime updatedAt;
}
Expand Down
7 changes: 7 additions & 0 deletions packages/globe_cli/lib/src/utils/scope.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ class GlobeScope {
'Either that project does not exists or you do not have permission to access to it.',
),
);

if (project.paused) {
throw Exception(
'Project #${metadata.projectId} is paused. '
'So, new deployments cannot be created for this project.',
);
}
} on ApiException catch (e) {
logger.err(e.message);
exitOverride(1);
Expand Down