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
242db5c1
Commit
242db5c1
authored
Feb 13, 2018
by
Guilhem Saurel
Browse files
generated .gitlab-ci.yml handles multiple robotpkgs
parent
64a1d6c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
rainboard/models.py
View file @
242db5c1
...
...
@@ -263,6 +263,9 @@ class Project(Links, NamedModel, TimeStampedModel):
def
open_pr
(
self
):
return
query_sum
(
self
.
repo_set
,
'open_pr'
)
def
gitlabciyml
(
self
):
return
get_template
(
'rainboard/gitlab-ci.yml'
).
render
({
'project'
:
self
})
class
Repo
(
TimeStampedModel
):
name
=
models
.
CharField
(
max_length
=
200
)
...
...
@@ -558,9 +561,6 @@ class Robotpkg(NamedModel):
def
valid_images
(
self
):
return
self
.
image_set
.
filter
(
created__isnull
=
False
)
def
gitlabciyml
(
self
):
return
get_template
(
'rainboard/gitlab-ci.yml'
).
render
({
'robotpkg'
:
self
})
class
RobotpkgBuild
(
TimeStampedModel
):
robotpkg
=
models
.
ForeignKey
(
Robotpkg
,
on_delete
=
models
.
CASCADE
)
...
...
rainboard/templates/rainboard/gitlab-ci.yml
View file @
242db5c1
...
...
@@ -2,17 +2,19 @@ variables:
GIT_SSL_NO_VERIFY
:
"
true"
GIT_SUBMODULE_STRATEGY
:
"
recursive"
GIT_DEPTH
:
"
3"
NAMESPACE
:
{{
robotpkg.project.main_namespace.slug
}}
PROJECT
:
{{
robotpkg.project
}}
ROBOTPKG
:
{{
robotpkg
}}
CATEGORY
:
{{
robotpkg.category
}}
NAMESPACE
:
{{
project.main_namespace.slug
}}
PROJECT
:
{{
project
}}
IMAGE
:
"
${CI_REGISTRY}/${NAMESPACE}/${PROJECT}"
cache
:
paths
:
-
build/ccache
{
%
for robotpkg in project.robotpkg_set.all %
}
.robotpkg-{{ robotpkg }}
:
&robotpkg-
{{
robotpkg
}}
variables
:
ROBOTPKG
:
{{
robotpkg
}}
CATEGORY
:
{{
robotpkg.category
}}
before_script
:
-
mkdir -p build/ccache
-
cd build
...
...
@@ -20,7 +22,7 @@ cache:
-
export CCACHE_DIR=${PWD}/ccache
script
:
-
cd /root/robotpkg/${CATEGORY}/${ROBOTPKG}
-
echo "REPOSITORY=git ${CI_PROJECT_DIR}" >> Makefile
-
echo "
MASTER_
REPOSITORY=git ${CI_PROJECT_DIR}" >> Makefile
-
make checkout
-
make install
-
cd work.*/${PROJECT}*/
...
...
@@ -34,3 +36,5 @@ robotpkg-{{ image }}:
<<
:
*robotpkg-
{{
robotpkg
}}
image
:
${IMAGE}:{{ image.get_target_display }}
{
%
endfor %
}
{
%
endfor %
}
rainboard/templates/rainboard/project_detail.html
View file @
242db5c1
...
...
@@ -75,12 +75,13 @@
<dt>
Build page
</dt>
<dd><a
href=
"{{ rpkg.build_page }}"
>
{{ rpkg.build_page }}
</a></dd>
</dl>
<h4>
generated .gitlab-ci.yml
</h4>
{% endfor %}
<h3>
generated .gitlab-ci.yml
</h3>
<pre>
{{
rpkg
.gitlabciyml }}
{{
project
.gitlabciyml }}
</pre>
{% endfor %}
{% endif %}
{% endblock %}
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