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
13940825
Commit
13940825
authored
Mar 02, 2018
by
Guilhem Saurel
Browse files
flake8, isort
parent
7811880c
Changes
10
Hide whitespace changes
Inline
Side-by-side
Dockerfile
View file @
13940825
...
...
@@ -5,6 +5,8 @@ EXPOSE 8000
RUN
mkdir
/app
WORKDIR
/app
RUN
apk update
&&
apk add
--no-cache
git
ADD
requirements.txt manage.py ./
RUN
pip
install
--no-cache-dir
-r
requirements.txt
&&
\
pip
install
--no-cache-dir
-U
https://github.com/jieter/django-tables2/archive/template-makeover.zip
...
...
docker-compose.yml
View file @
13940825
...
...
@@ -4,7 +4,7 @@ services:
app
:
build
:
.
volumes
:
-
./db.sqlite3:
.
/db.sqlite3
-
./db.sqlite3:
/app
/db.sqlite3
-
/srv/dashboard/repositories:/srv/dashboard/repositories
-
/srv/dashboard/robotpkg:/srv/dashboard/robotpkg
ports
:
...
...
rainboard/management/commands/docker-build.py
View file @
13940825
...
...
@@ -3,7 +3,7 @@ from subprocess import call
from
django.core.management.base
import
BaseCommand
from
rainboard.models
import
Image
,
Robotpkg
from
rainboard.models
import
Image
logger
=
logging
.
getLogger
(
'rainboard.docker'
)
...
...
rainboard/management/commands/docker-pull.py
View file @
13940825
...
...
@@ -3,7 +3,7 @@ from subprocess import call
from
django.core.management.base
import
BaseCommand
from
rainboard.models
import
Image
,
Robotpkg
from
rainboard.models
import
Image
logger
=
logging
.
getLogger
(
'rainboard.docker'
)
...
...
@@ -14,4 +14,4 @@ class Command(BaseCommand):
def
handle
(
self
,
*
args
,
**
options
):
logger
.
info
(
'Pulling all docker images…'
)
for
image
in
Image
.
objects
.
all
():
ret
=
call
(
image
.
pull
())
call
(
image
.
pull
())
rainboard/management/commands/docker-push.py
View file @
13940825
...
...
@@ -3,7 +3,7 @@ from subprocess import call
from
django.core.management.base
import
BaseCommand
from
rainboard.models
import
Image
,
Robotpkg
from
rainboard.models
import
Image
logger
=
logging
.
getLogger
(
'rainboard.docker'
)
...
...
@@ -14,4 +14,4 @@ class Command(BaseCommand):
def
handle
(
self
,
*
args
,
**
options
):
logger
.
info
(
'Pushing all docker images…'
)
for
image
in
Image
.
objects
.
all
():
ret
=
call
(
image
.
push
())
call
(
image
.
push
())
rainboard/management/commands/robotpkg.py
View file @
13940825
...
...
@@ -21,7 +21,8 @@ class Command(BaseCommand):
for
project
in
Project
.
objects
.
all
():
for
slug
in
[
project
.
slug
,
project
.
slug
.
replace
(
'_'
,
'-'
)]:
for
pkg
in
path
.
glob
(
f
'*/
{
slug
}
'
):
obj
,
created
=
Robotpkg
.
objects
.
get_or_create
(
name
=
pkg
.
name
,
category
=
pkg
.
parent
.
name
,
project
=
project
)
obj
,
created
=
Robotpkg
.
objects
.
get_or_create
(
name
=
pkg
.
name
,
category
=
pkg
.
parent
.
name
,
project
=
project
)
if
created
:
logger
.
info
(
f
'
{
project
}
found in
{
pkg
}
'
)
obj
.
update
(
pull
=
False
)
rainboard/migrations/0003_image.py
View file @
13940825
# Generated by Django 2.0.2 on 2018-02-12 15:41
from
django.db
import
migrations
,
models
import
django.db.models.deletion
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
...
...
rainboard/migrations/0004_contributor_contributormail_contributorname.py
View file @
13940825
# Generated by Django 2.0.2 on 2018-02-15 18:19
from
django.db
import
migrations
,
models
import
django.db.models.deletion
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
...
...
rainboard/models.py
View file @
13940825
import
json
import
logging
import
re
from
subprocess
import
check_output
,
CalledProcessError
from
subprocess
import
CalledProcessError
,
check_output
from
django.conf
import
settings
from
django.db
import
models
...
...
@@ -15,7 +15,7 @@ from autoslug import AutoSlugField
from
ndh.models
import
Links
,
NamedModel
,
TimeStampedModel
from
ndh.utils
import
enum_to_choices
,
query_sum
from
.utils
import
SOURCES
,
TARGETS
,
api_next
,
slugify_with_dots
,
invalid_mail
from
.utils
import
SOURCES
,
TARGETS
,
api_next
,
invalid_mail
,
slugify_with_dots
logger
=
logging
.
getLogger
(
'rainboard.models'
)
...
...
@@ -675,7 +675,6 @@ class Contributor(models.Model):
return
', '
.
join
(
str
(
project
)
for
project
in
self
.
projects
.
all
())
class
ContributorName
(
models
.
Model
):
contributor
=
models
.
ForeignKey
(
Contributor
,
on_delete
=
models
.
CASCADE
,
blank
=
True
,
null
=
True
)
name
=
models
.
CharField
(
max_length
=
200
,
unique
=
True
)
...
...
rainboard/views.py
View file @
13940825
from
django.views.generic
import
CreateView
,
DetailView
from
django.views.generic
import
DetailView
from
django_filters.views
import
FilterView
from
django_tables2
import
RequestConfig
from
django_tables2.views
import
SingleTableMixin
,
SingleTableView
from
.
import
models
,
tables
,
filters
from
.
import
filters
,
models
,
tables
class
ForgesView
(
SingleTableView
):
...
...
@@ -68,6 +68,7 @@ class ProjectContributorsView(ProjectTableView):
def
get_object_list
(
self
):
return
self
.
object
.
contributors
()
class
ProjectGitlabView
(
ProjectView
):
template_name
=
'rainboard/gitlab-ci.yml'
content_type
=
'application/x-yaml'
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment