-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
main: add basic support for repo + worker (bug 1865907) (#5)
- add Repo and Worker models - add basic support commands - add method to initialize repo in filesystem
- Loading branch information
Showing
3 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Generated by Django 5.0b1 on 2023-11-23 19:56 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("main", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Repo", | ||
fields=[ | ||
( | ||
"basemodel_ptr", | ||
models.OneToOneField( | ||
auto_created=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
parent_link=True, | ||
primary_key=True, | ||
serialize=False, | ||
to="main.basemodel", | ||
), | ||
), | ||
("name", models.CharField(max_length=255, unique=True)), | ||
("default_branch", models.CharField(default="main", max_length=255)), | ||
("url", models.CharField(max_length=255)), | ||
("push_path", models.CharField(max_length=255)), | ||
("pull_path", models.CharField(max_length=255)), | ||
("is_initialized", models.BooleanField(default=False)), | ||
( | ||
"system_path", | ||
models.FilePathField( | ||
allow_folders=True, max_length=255, path="/mediafiles/repos" | ||
), | ||
), | ||
], | ||
bases=("main.basemodel",), | ||
), | ||
migrations.CreateModel( | ||
name="Worker", | ||
fields=[ | ||
( | ||
"basemodel_ptr", | ||
models.OneToOneField( | ||
auto_created=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
parent_link=True, | ||
primary_key=True, | ||
serialize=False, | ||
to="main.basemodel", | ||
), | ||
), | ||
("name", models.CharField(max_length=255, unique=True)), | ||
("is_paused", models.BooleanField(default=False)), | ||
("is_stopped", models.BooleanField(default=False)), | ||
("ssh_private_key", models.TextField(blank=True, null=True)), | ||
("throttle_seconds", models.IntegerField(default=10)), | ||
("sleep_seconds", models.IntegerField(default=10)), | ||
("applicable_repos", models.ManyToManyField(to="main.repo")), | ||
], | ||
bases=("main.basemodel",), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters