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
7c501d5b
Commit
7c501d5b
authored
Jul 01, 2019
by
Guilhem Saurel
Browse files
pipeline schedules
parent
8b05e014
Pipeline
#4737
passed with stage
in 55 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
rainboard/models.py
View file @
7c501d5b
...
...
@@ -408,6 +408,18 @@ class Project(Links, NamedModel, TimeStampedModel):
travis
=
self
.
badge_travis
()
if
self
.
public
else
mark_safe
(
''
)
return
travis
+
self
.
badge_gitlab
()
+
self
.
badge_coverage
()
def
cron
(
self
):
""" generate a cron-style interval description to run CI monthly on master """
hour
,
day
=
(
self
.
pk
//
30
)
%
24
,
self
.
pk
%
30
+
1
return
f
'0
{
hour
}
{
day
}
* *'
def
pipeline_schedules
(
self
):
""" provides a link to gitlab's CI schedules page showing then cron rule to use with this project """
repo
=
self
.
filter
(
forge__source
=
SOURCES
.
gitlab
,
namespace__group
=
True
)
if
repo
.
exists
():
link
=
repo
.
first
().
url
+
'/pipeline_schedules'
return
mark_safe
(
f
'<a href="
{
link
}
">
{
self
.
cron
}
</a>'
)
class
Repo
(
TimeStampedModel
):
name
=
models
.
CharField
(
max_length
=
200
)
...
...
rainboard/templates/rainboard/project_detail.html
View file @
7c501d5b
...
...
@@ -13,14 +13,19 @@
{% else %}
{% bootstrap_label 'UNLICENSED' label_class='label label-warning' %}
{% endif %}
<br>
{% if project.public %}
{% bootstrap_label 'public' label_class='label label-success' %}
{% else %}
{% bootstrap_label 'private' label_class='label label-danger' %}
{% endif %}
<br>
{{ project.badges }}
<br>
{{ project.pipeline_schedules }}
</div>
<dl
class=
"row"
style=
"line-height: 1"
>
...
...
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