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
6a2a9506
Commit
6a2a9506
authored
Feb 28, 2018
by
Guilhem Saurel
Browse files
split between public and private registries
parent
b18de578
Changes
5
Hide whitespace changes
Inline
Side-by-side
Dockerfile
View file @
6a2a9506
ARG
REGISTRY=eur0c.laas.fr:
4567
ARG
NAMESPACE=
gsaurel/
buildfarm
ARG
REGISTRY=eur0c.laas.fr:
5000
ARG
NAMESPACE=buildfarm
ARG
IMAGE=robotpkg
ARG
TARGET=14.04
...
...
dashboard/settings.py
View file @
6a2a9506
...
...
@@ -158,4 +158,5 @@ LOGGING = {
RAINBOARD_DATA
=
Path
(
'/srv/dashboard'
)
RAINBOARD_GITS
=
RAINBOARD_DATA
/
'repositories'
RAINBOARD_RPKG
=
RAINBOARD_DATA
/
'robotpkg'
REGISTRY
=
'eur0c.laas.fr:4567'
PRIVATE_REGISTRY
=
'eur0c.laas.fr:4567'
PUBLIC_REGISTRY
=
'eur0c.laas.fr:5000'
rainboard/management/commands/docker-build.py
View file @
6a2a9506
...
...
@@ -12,13 +12,9 @@ class Command(BaseCommand):
help
=
'Create all docker images'
def
handle
(
self
,
*
args
,
**
options
):
logger
.
info
(
'Creating all docker images…'
)
for
robotpkg
in
Robotpkg
.
objects
.
all
():
logger
.
info
(
f
'
{
robotpkg
}
'
)
robotpkg
.
update_images
()
logger
.
info
(
'Building all docker images…'
)
for
image
in
Image
.
objects
.
all
():
ret
=
call
(
image
.
build
())
logger
.
info
(
f
'
{
image
}
:
{
ret
}
'
)
if
ret
==
0
:
image
.
update
()
rainboard/models.py
View file @
6a2a9506
...
...
@@ -279,6 +279,9 @@ class Project(Links, NamedModel, TimeStampedModel):
contributor
.
save
()
return
self
.
contributor_set
.
all
()
def
registry
(
self
):
return
settings
.
PUBLIC_REGISTRY
if
self
.
public
else
settings
.
PRIVATE_REGISTRY
class
Repo
(
TimeStampedModel
):
name
=
models
.
CharField
(
max_length
=
200
)
...
...
@@ -594,14 +597,15 @@ class Image(models.Model):
return
f
'
{
self
.
robotpkg
}
-
{
self
.
get_target_display
()
}
'
def
get_build_args
(
self
):
ret
=
{
'TARGET'
:
self
.
get_target_display
(),
'ROBOTPKG'
:
self
.
robotpkg
}
ret
=
{
'TARGET'
:
self
.
get_target_display
(),
'ROBOTPKG'
:
self
.
robotpkg
,
'REGISTRY'
:
self
.
robotpkg
.
project
.
registry
}
if
not
self
.
robotpkg
.
project
.
public
:
ret
[
'IMAGE'
]
=
'robotpkg-jrl'
return
ret
def
get_image_name
(
self
):
project
=
self
.
robotpkg
.
project
return
f
'
{
settings
.
REGISTRY
}
/
{
project
.
main_namespace
.
slug
}
/
{
project
}
:
{
self
.
get_target_display
()
}
'
return
f
'
{
project
.
registry
}
/
{
project
.
main_namespace
.
slug
}
/
{
project
}
:
{
self
.
get_target_display
()
}
'
def
build
(
self
):
args
=
self
.
get_build_args
()
...
...
rainboard/templates/rainboard/gitlab-ci.yml
View file @
6a2a9506
...
...
@@ -4,7 +4,8 @@ variables:
GIT_DEPTH
:
"
3"
NAMESPACE
:
{{
project.main_namespace.slug
}}
PROJECT
:
{{
project
}}
IMAGE
:
"
${CI_REGISTRY}/${NAMESPACE}/${PROJECT}"
REGISTRY
:
{{
project.registry
}}
IMAGE
:
"
${REGISTRY}/${NAMESPACE}/${PROJECT}"
cache
:
paths
:
...
...
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