Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gepetto
dashboard
Commits
ca734fd7
Commit
ca734fd7
authored
Feb 06, 2018
by
Guilhem Saurel
Browse files
big refactor wip…
parent
d6ac68a2
Changes
26
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
ca734fd7
...
...
@@ -15,7 +15,14 @@ export REDMINE_TOKEN=xxx
export OPENROB_TOKEN=xxx
./manage.py migrate
./manage.py populate
./manage.py fetch
./manage.py robotpkg
./manage.py cmake
./manage.py travis
./manage.py update
./manage.py runserver
```
or, as a shortcut,
`./launch.sh`
You can go to http://localhost:8000
launch.sh
0 → 100755
View file @
ca734fd7
#!/bin/bash
set
-ex
source
.env
./manage.py migrate
./manage.py populate
./manage.py fetch
./manage.py robotpkg
./manage.py cmake
./manage.py travis
./manage.py update
./manage.py runserver
rainboard/management/commands/fetch.py
View file @
ca734fd7
...
...
@@ -6,6 +6,7 @@ from rainboard.models import Project
logger
=
logging
.
getLogger
(
'rainboard.management.fetch'
)
class
Command
(
BaseCommand
):
help
=
'Fetch all remotes'
...
...
rainboard/management/commands/populate.py
View file @
ca734fd7
...
...
@@ -4,11 +4,12 @@ from django.core.management.base import BaseCommand
import
requests
from
rainboard.models
import
Forge
,
License
,
Repo
from
rainboard.models
import
Forge
,
License
,
Repo
,
Project
LICENSES
=
'https://raw.githubusercontent.com/spdx/license-list-data/master/json/licenses.json'
logger
=
logging
.
getLogger
(
'rainboard.management.populate'
)
class
Command
(
BaseCommand
):
help
=
'populates licenses, projets, namespaces and repos from forges'
...
...
@@ -23,10 +24,10 @@ class Command(BaseCommand):
# for data in requests.get(f'{github.api_url()}/licenses', headers=github.headers()).json():
# logger.info(f' updating license {data["name"]}')
# License.objects.get_or_create(spdx_id=data['spdx_id'],
#
defaults={key: data[key] for key in ['name', 'url']})
#
defaults={key: data[key] for key in ['name', 'url']})
logger
.
info
(
f
'updating forges'
)
for
forge
in
Forge
.
objects
.
all
(
):
for
forge
in
Forge
.
objects
.
order_by
(
'source'
):
logger
.
info
(
f
' updating
{
forge
}
'
)
forge
.
get_projects
()
...
...
@@ -34,3 +35,6 @@ class Command(BaseCommand):
for
repo
in
Repo
.
objects
.
all
():
logger
.
info
(
f
' updating
{
repo
}
'
)
repo
.
api_update
()
logger
.
info
(
f
'removing unwanted projects'
)
Project
.
objects
.
filter
(
main_namespace__group
=
False
).
delete
()
rainboard/management/commands/robotpkg.py
View file @
ca734fd7
import
logging
from
django.core.management.base
import
BaseCommand
from
django.conf
import
settings
from
rainboard.models
import
Project
,
Robotpkg
from
django.core.management.base
import
BaseCommand
import
git
from
rainboard.models
import
Project
,
Robotpkg
logger
=
logging
.
getLogger
(
'rainboard.robotpkg'
)
...
...
rainboard/management/commands/travis.py
View file @
ca734fd7
...
...
@@ -3,9 +3,7 @@ import os
from
django.core.management.base
import
BaseCommand
import
requests
from
rainboard.models
import
Repo
,
Namespace
,
Forge
,
SOURCES
,
Project
from
rainboard.models
import
SOURCES
,
Forge
,
Namespace
,
Project
,
Repo
logger
=
logging
.
getLogger
(
'rainboard.management.travis'
)
...
...
rainboard/management/commands/update.py
0 → 100644
View file @
ca734fd7
import
logging
from
django.conf
import
settings
from
django.core.management.base
import
BaseCommand
import
git
from
rainboard.models
import
Branch
,
Project
,
Repo
,
Robotpkg
logger
=
logging
.
getLogger
(
'rainboard.management.update'
)
class
Command
(
BaseCommand
):
help
=
'Update the DB'
def
handle
(
self
,
*
args
,
**
options
):
logger
.
info
(
f
'
\n
Updating all repos
\n
'
)
for
repo
in
Repo
.
objects
.
all
():
logger
.
info
(
f
'
{
repo
}
'
)
repo
.
update
()
logger
.
info
(
f
'
\n
Updating all branches
\n
'
)
for
branch
in
Branch
.
objects
.
all
():
logger
.
info
(
f
'
{
branch
}
'
)
branch
.
update
(
pull
=
False
)
logger
.
info
(
f
'
\n
Pulling Robotpkg
\n
'
)
git
.
Repo
(
str
(
settings
.
RAINBOARD_RPKG
/
'.git'
)).
remotes
.
origin
.
pull
()
git
.
Repo
(
str
(
settings
.
RAINBOARD_RPKG
/
'wip'
/
'.git'
)).
remotes
.
origin
.
pull
()
logger
.
info
(
f
'
\n
Updating Robotpkg
\n
'
)
for
robotpkg
in
Robotpkg
.
objects
.
all
():
logger
.
info
(
f
'
{
robotpkg
}
'
)
robotpkg
.
update
(
pull
=
False
)
logger
.
info
(
f
'
\n
Updating all projects
\n
'
)
for
project
in
Project
.
objects
.
all
():
logger
.
info
(
f
'
{
project
}
'
)
project
.
update
()
rainboard/migrations/0001_initial.py
View file @
ca734fd7
# Generated by Django 2.0.1 on 2018-0
1-12
18:
05
# Generated by Django 2.0.1 on 2018-0
2-06
18:
47
import
autoslug.fields
from
django.conf
import
settings
from
django.db
import
migrations
,
models
import
django.db.models.deletion
import
ndh.models
import
rainboard.utils
class
Migration
(
migrations
.
Migration
):
...
...
@@ -36,12 +37,23 @@ class Migration(migrations.Migration):
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'updated'
,
models
.
DateTimeField
(
auto_now
=
True
)),
(
'name'
,
models
.
CharField
(
max_length
=
200
,
unique
=
True
)),
(
'slug'
,
autoslug
.
fields
.
AutoSlugField
(
editable
=
False
,
populate_from
=
'name'
,
unique
=
True
)),
(
'name'
,
models
.
CharField
(
max_length
=
200
)),
(
'ahead'
,
models
.
PositiveSmallIntegerField
(
blank
=
True
,
null
=
True
)),
(
'behind'
,
models
.
PositiveSmallIntegerField
(
blank
=
True
,
null
=
True
)),
(
'updated'
,
models
.
DateTimeField
(
blank
=
True
,
null
=
True
)),
],
),
migrations
.
CreateModel
(
name
=
'CIBuild'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'passed'
,
models
.
NullBooleanField
()),
(
'build_id'
,
models
.
PositiveIntegerField
()),
(
'started'
,
models
.
DateTimeField
()),
(
'branch'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'rainboard.Branch'
)),
],
options
=
{
'
abstract'
:
False
,
'
ordering'
:
(
'started'
,)
,
},
),
migrations
.
CreateModel
(
...
...
@@ -53,9 +65,6 @@ class Migration(migrations.Migration):
(
'name'
,
models
.
CharField
(
max_length
=
200
,
unique
=
True
)),
(
'slug'
,
autoslug
.
fields
.
AutoSlugField
(
editable
=
False
,
populate_from
=
'name'
,
unique
=
True
)),
],
options
=
{
'abstract'
:
False
,
},
),
migrations
.
CreateModel
(
name
=
'Forge'
,
...
...
@@ -63,7 +72,7 @@ class Migration(migrations.Migration):
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'name'
,
models
.
CharField
(
max_length
=
200
,
unique
=
True
)),
(
'slug'
,
autoslug
.
fields
.
AutoSlugField
(
editable
=
False
,
populate_from
=
'name'
,
unique
=
True
)),
(
'source'
,
models
.
PositiveSmallIntegerField
(
choices
=
[(
1
,
'github'
),
(
2
,
'gitlab'
),
(
3
,
'redmine'
),
(
4
,
'robotpkg'
)])),
(
'source'
,
models
.
PositiveSmallIntegerField
(
choices
=
[(
1
,
'github'
),
(
2
,
'gitlab'
),
(
3
,
'redmine'
),
(
4
,
'robotpkg'
)
,
(
5
,
'travis'
)
])),
(
'url'
,
models
.
URLField
()),
(
'token'
,
models
.
CharField
(
blank
=
True
,
max_length
=
50
,
null
=
True
)),
(
'verify'
,
models
.
BooleanField
(
default
=
True
)),
...
...
@@ -99,13 +108,16 @@ class Migration(migrations.Migration):
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'updated'
,
models
.
DateTimeField
(
auto_now
=
True
)),
(
'name'
,
models
.
CharField
(
max_length
=
200
,
unique
=
True
)),
(
'slug'
,
autoslug
.
fields
.
AutoSlugField
(
editable
=
False
,
populate_from
=
'name'
,
unique
=
True
)),
(
'private'
,
models
.
BooleanField
(
default
=
False
)),
(
'homepage'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
(
'description'
,
models
.
TextField
()),
(
'version'
,
models
.
CharField
(
blank
=
True
,
max_length
=
20
,
null
=
True
)),
(
'updated'
,
models
.
DateTimeField
(
blank
=
True
,
null
=
True
)),
(
'articles'
,
models
.
ManyToManyField
(
to
=
'rainboard.Article'
)),
(
'license'
,
models
.
ForeignKey
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
to
=
'rainboard.License'
)),
(
'main_forge'
,
models
.
ForeignKey
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
to
=
'rainboard.Forge'
)),
(
'main_namespace'
,
models
.
ForeignKey
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
to
=
'rainboard.Namespace'
)),
],
options
=
{
...
...
@@ -120,7 +132,7 @@ class Migration(migrations.Migration):
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'updated'
,
models
.
DateTimeField
(
auto_now
=
True
)),
(
'name'
,
models
.
CharField
(
max_length
=
200
)),
(
'slug'
,
autoslug
.
fields
.
AutoSlugField
(
editable
=
False
,
populate_from
=
'name'
)),
(
'slug'
,
autoslug
.
fields
.
AutoSlugField
(
editable
=
False
,
populate_from
=
'name'
,
slugify
=
rainboard
.
utils
.
slugify_with_dots
)),
(
'homepage'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
(
'url'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
(
'default_branch'
,
models
.
CharField
(
max_length
=
50
)),
...
...
@@ -129,6 +141,7 @@ class Migration(migrations.Migration):
(
'repo_id'
,
models
.
PositiveIntegerField
()),
(
'forked_from'
,
models
.
PositiveIntegerField
(
blank
=
True
,
null
=
True
)),
(
'clone_url'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
(
'travis_id'
,
models
.
PositiveIntegerField
(
blank
=
True
,
null
=
True
)),
(
'forge'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'rainboard.Forge'
)),
(
'license'
,
models
.
ForeignKey
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
to
=
'rainboard.License'
)),
(
'namespace'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'rainboard.Namespace'
)),
...
...
@@ -144,9 +157,19 @@ class Migration(migrations.Migration):
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'name'
,
models
.
CharField
(
max_length
=
200
,
unique
=
True
)),
(
'slug'
,
autoslug
.
fields
.
AutoSlugField
(
editable
=
False
,
populate_from
=
'name'
,
unique
=
True
)),
(
'homepage'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
(
'category'
,
models
.
CharField
(
max_length
=
50
)),
(
'pkgbase'
,
models
.
CharField
(
default
=
''
,
max_length
=
50
)),
(
'pkgversion'
,
models
.
CharField
(
default
=
''
,
max_length
=
20
)),
(
'master_sites'
,
models
.
CharField
(
default
=
''
,
max_length
=
200
)),
(
'master_repository'
,
models
.
CharField
(
default
=
''
,
max_length
=
200
)),
(
'maintainer'
,
models
.
CharField
(
default
=
''
,
max_length
=
200
)),
(
'comment'
,
models
.
TextField
()),
(
'homepage'
,
models
.
URLField
(
default
=
''
)),
(
'private'
,
models
.
BooleanField
(
default
=
False
)),
(
'description'
,
models
.
TextField
()),
(
'updated'
,
models
.
DateTimeField
(
blank
=
True
,
null
=
True
)),
(
'license'
,
models
.
ForeignKey
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
to
=
'rainboard.License'
)),
(
'project'
,
models
.
OneToOneField
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'rainboard.Project'
)),
(
'project'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'rainboard.Project'
)),
],
options
=
{
'abstract'
:
False
,
...
...
@@ -158,7 +181,7 @@ class Migration(migrations.Migration):
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'updated'
,
models
.
DateTimeField
(
auto_now
=
True
)),
(
'target'
,
models
.
PositiveSmallIntegerField
(
choices
=
[(
1
,
'1
2
.04'
),
(
2
,
'1
4
.04'
),
(
3
,
'1
6.04
'
),
(
4
,
'dubnium'
)])),
(
'target'
,
models
.
PositiveSmallIntegerField
(
choices
=
[(
1
,
'1
4
.04'
),
(
2
,
'1
6
.04'
),
(
3
,
'1
7.10
'
),
(
4
,
'18.04'
),
(
5
,
'dubnium'
)])),
(
'passed'
,
models
.
BooleanField
(
default
=
False
)),
(
'robotpkg'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'rainboard.Robotpkg'
)),
],
...
...
@@ -167,11 +190,12 @@ class Migration(migrations.Migration):
},
),
migrations
.
CreateModel
(
name
=
'
Robotpkg
Dependency'
,
name
=
'
System
Dependency'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'name'
,
models
.
CharField
(
max_length
=
200
,
unique
=
True
)),
(
'slug'
,
autoslug
.
fields
.
AutoSlugField
(
editable
=
False
,
populate_from
=
'name'
,
unique
=
True
)),
(
'target'
,
models
.
PositiveSmallIntegerField
(
choices
=
[(
1
,
'14.04'
),
(
2
,
'16.04'
),
(
3
,
'17.10'
),
(
4
,
'18.04'
),
(
5
,
'dubnium'
)])),
(
'project'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'rainboard.Project'
)),
],
options
=
{
...
...
@@ -179,16 +203,15 @@ class Migration(migrations.Migration):
},
),
migrations
.
CreateModel
(
name
=
'
SystemDependency
'
,
name
=
'
Tag
'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'name'
,
models
.
CharField
(
max_length
=
200
,
unique
=
True
)),
(
'slug'
,
autoslug
.
fields
.
AutoSlugField
(
editable
=
False
,
populate_from
=
'name'
,
unique
=
True
)),
(
'target'
,
models
.
PositiveSmallIntegerField
(
choices
=
[(
1
,
'12.04'
),
(
2
,
'14.04'
),
(
3
,
'16.04'
),
(
4
,
'dubnium'
)])),
(
'name'
,
models
.
CharField
(
max_length
=
200
)),
(
'slug'
,
autoslug
.
fields
.
AutoSlugField
(
editable
=
False
,
populate_from
=
'name'
,
slugify
=
rainboard
.
utils
.
slugify_with_dots
)),
(
'project'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'rainboard.Project'
)),
],
options
=
{
'
abstract'
:
False
,
'
ordering'
:
(
'name'
,)
,
},
),
migrations
.
CreateModel
(
...
...
@@ -197,7 +220,7 @@ class Migration(migrations.Migration):
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'updated'
,
models
.
DateTimeField
(
auto_now
=
True
)),
(
'target'
,
models
.
PositiveSmallIntegerField
(
choices
=
[(
1
,
'1
2
.04'
),
(
2
,
'1
4
.04'
),
(
3
,
'1
6.04
'
),
(
4
,
'dubnium'
)])),
(
'target'
,
models
.
PositiveSmallIntegerField
(
choices
=
[(
1
,
'1
4
.04'
),
(
2
,
'1
6
.04'
),
(
3
,
'1
7.10
'
),
(
4
,
'18.04'
),
(
5
,
'dubnium'
)])),
(
'passed'
,
models
.
BooleanField
(
default
=
False
)),
(
'branch'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'rainboard.Branch'
)),
(
'commit'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'rainboard.Commit'
)),
...
...
@@ -212,14 +235,31 @@ class Migration(migrations.Migration):
name
=
'project'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'rainboard.Project'
),
),
migrations
.
AddField
(
model_name
=
'cibuild'
,
name
=
'repo'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'rainboard.Repo'
),
),
migrations
.
AddField
(
model_name
=
'branch'
,
name
=
'
commi
t'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'rainboard.
Commi
t'
),
name
=
'
projec
t'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'rainboard.
Projec
t'
),
),
migrations
.
AddField
(
model_name
=
'branch'
,
name
=
'repo'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'rainboard.Repo'
),
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'rainboard.Repo'
),
),
migrations
.
AlterUniqueTogether
(
name
=
'tag'
,
unique_together
=
{(
'name'
,
'project'
)},
),
migrations
.
AlterUniqueTogether
(
name
=
'commit'
,
unique_together
=
{(
'project'
,
'name'
)},
),
migrations
.
AlterUniqueTogether
(
name
=
'branch'
,
unique_together
=
{(
'project'
,
'name'
)},
),
]
rainboard/migrations/0002_forges.py
→
rainboard/migrations/0002_forges
_groups
.py
View file @
ca734fd7
...
...
@@ -20,6 +20,13 @@ def forges(apps, schema_editor):
Forge
.
objects
.
create
(
name
=
'Openrobots'
,
source
=
SOURCES
.
redmine
,
url
=
'https://git.openrobots.org'
,
token
=
os
.
getenv
(
'OPENROB_TOKEN'
))
def
groups
(
apps
,
schema_editor
):
Namespace
=
apps
.
get_model
(
'rainboard'
,
'Namespace'
)
Namespace
.
objects
.
create
(
name
=
'Humanoid Path Planner'
,
group
=
True
)
Namespace
.
objects
.
create
(
name
=
'Stack Of Tasks'
,
group
=
True
)
Namespace
.
objects
.
create
(
name
=
'Gepetto'
,
group
=
True
)
Namespace
.
objects
.
create
(
name
=
'Pyrène Dev'
,
group
=
True
)
class
Migration
(
migrations
.
Migration
):
...
...
@@ -29,4 +36,5 @@ class Migration(migrations.Migration):
operations
=
[
migrations
.
RunPython
(
forges
),
migrations
.
RunPython
(
groups
),
]
rainboard/migrations/0003_slugify_with_dots.py
deleted
100644 → 0
View file @
d6ac68a2
# Generated by Django 2.0.1 on 2018-01-29 16:43
import
autoslug.fields
from
django.db
import
migrations
import
rainboard.utils
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'rainboard'
,
'0002_forges'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'repo'
,
name
=
'slug'
,
field
=
autoslug
.
fields
.
AutoSlugField
(
editable
=
False
,
populate_from
=
'name'
,
slugify
=
rainboard
.
utils
.
slugify_with_dots
),
),
]
rainboard/migrations/0004_project_main_forge.py
deleted
100644 → 0
View file @
d6ac68a2
# Generated by Django 2.0.1 on 2018-01-29 17:12
from
django.db
import
migrations
,
models
import
django.db.models.deletion
def
forges
(
apps
,
schema_editor
):
Forge
=
apps
.
get_model
(
'rainboard'
,
'Forge'
)
forges
=
[
Forge
.
objects
.
get
(
name
=
forge
)
for
forge
in
[
'Github'
,
'Gitlab'
,
'Redmine'
,
'Openrobots'
]]
Project
=
apps
.
get_model
(
'rainboard'
,
'Project'
)
for
project
in
Project
.
objects
.
all
():
for
forge
in
forges
:
if
project
.
repo_set
.
filter
(
forge
=
forge
).
exists
():
project
.
main_forge
=
forge
project
.
save
()
break
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'rainboard'
,
'0003_slugify_with_dots'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'project'
,
name
=
'main_forge'
,
field
=
models
.
ForeignKey
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
to
=
'rainboard.Forge'
),
),
migrations
.
RunPython
(
forges
),
]
rainboard/migrations/0005_branches.py
deleted
100644 → 0
View file @
d6ac68a2
# Generated by Django 2.0.1 on 2018-01-30 14:44
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'rainboard'
,
'0004_project_main_forge'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'branch'
,
name
=
'commit'
,
),
migrations
.
RemoveField
(
model_name
=
'branch'
,
name
=
'repo'
,
),
migrations
.
AddField
(
model_name
=
'branch'
,
name
=
'ahead'
,
field
=
models
.
PositiveSmallIntegerField
(
blank
=
True
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'branch'
,
name
=
'behind'
,
field
=
models
.
PositiveSmallIntegerField
(
blank
=
True
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'branch'
,
name
=
'project'
,
field
=
models
.
ForeignKey
(
default
=
0
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'rainboard.Project'
),
preserve_default
=
False
,
),
]
rainboard/migrations/0006_auto_20180130_1456.py
deleted
100644 → 0
View file @
d6ac68a2
# Generated by Django 2.0.1 on 2018-01-30 14:56
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'rainboard'
,
'0005_branches'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'branch'
,
name
=
'slug'
,
),
migrations
.
AlterField
(
model_name
=
'branch'
,
name
=
'name'
,
field
=
models
.
CharField
(
max_length
=
200
),
),
]
rainboard/migrations/0007_auto_20180130_1457.py
deleted
100644 → 0
View file @
d6ac68a2
# Generated by Django 2.0.1 on 2018-01-30 14:57
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'rainboard'
,
'0006_auto_20180130_1456'
),
]
operations
=
[
migrations
.
AlterUniqueTogether
(
name
=
'branch'
,
unique_together
=
{(
'project'
,
'name'
)},
),
]
rainboard/migrations/0008_project_description.py
deleted
100644 → 0
View file @
d6ac68a2
# Generated by Django 2.0.1 on 2018-01-30 17:12
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'rainboard'
,
'0007_auto_20180130_1457'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'project'
,
name
=
'description'
,
field
=
models
.
TextField
(
default
=
''
),
preserve_default
=
False
,
),
]
rainboard/migrations/0009_project_version.py
deleted
100644 → 0
View file @
d6ac68a2
# Generated by Django 2.0.1 on 2018-01-30 17:13
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'rainboard'
,
'0008_project_description'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'project'
,
name
=
'version'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
20
,
null
=
True
),
),
]
rainboard/migrations/0010_robotpkg.py
deleted
100644 → 0
View file @
d6ac68a2
# Generated by Django 2.0.1 on 2018-01-31 15:48
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'rainboard'
,
'0009_project_version'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'robotpkgdependency'
,
name
=
'project'
,
),
migrations
.
AddField
(
model_name
=
'robotpkg'
,
name
=
'category'
,
field
=
models
.
CharField
(
default
=
''
,
max_length
=
50
),
preserve_default
=
False
,
),
migrations
.
AddField
(
model_name
=
'robotpkg'
,
name
=
'comment'
,
field
=
models
.
TextField
(
default
=
''
),
preserve_default
=
False
,
),
migrations
.
AddField
(
model_name
=
'robotpkg'
,
name
=
'description'
,
field
=
models
.
TextField
(
default
=
''
),
preserve_default
=
False
,
),
migrations
.
AddField
(
model_name
=
'robotpkg'
,
name
=
'maintainer'
,
field
=
models
.
CharField
(
default
=
''
,
max_length
=
200
),
),
migrations
.
AddField
(
model_name
=
'robotpkg'
,
name
=
'master_repository'
,
field
=
models
.
CharField
(
default
=
''
,
max_length
=
200
),
),