Открыть боковую панель
nt_test121
nt_project_9da4a5yt9x4b
Коммиты
9a82702a
Коммит
9a82702a
создал
Окт 17, 2015
по автору
Douwe Maan
Просмотр файлов
Move commit/:sha/ci to commit/:sha/builds.
владелец
49be57ae
Изменения
5
Скрыть пробелы
Построчно
Рядом
app/controllers/projects/commit_controller.rb
Просмотр файла @
9a82702a
...
...
@@ -6,8 +6,8 @@ class Projects::CommitController < Projects::ApplicationController
before_action
:require_non_empty_project
before_action
:authorize_download_code!
before_action
:commit
before_action
:define_show_vars
,
only:
[
:show
,
:ci
]
before_action
:authorize_manage_builds!
,
only:
[
:cancel_builds
,
:retry_builds
]
before_action
:define_show_vars
,
only:
[
:show
,
:builds
]
def
show
return
git_not_found!
unless
@commit
...
...
@@ -29,7 +29,7 @@ def show
end
end
def
ci
def
builds
@ci_project
=
@project
.
gitlab_ci_project
end
...
...
@@ -37,7 +37,7 @@ def cancel_builds
@ci_commit
=
@project
.
ci_commit
(
@commit
.
sha
)
@ci_commit
.
builds
.
running_or_pending
.
each
(
&
:cancel
)
redirect_to
ci
_namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
.
sha
)
redirect_to
builds
_namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
.
sha
)
end
def
retry_builds
...
...
@@ -48,7 +48,7 @@ def retry_builds
end
end
redirect_to
ci
_namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
.
sha
)
redirect_to
builds
_namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
.
sha
)
end
def
branches
...
...
app/helpers/ci_status_helper.rb
Просмотр файла @
9a82702a
module
CiStatusHelper
def
ci_status_path
(
ci_commit
)
project
=
ci_commit
.
gl_project
ci
_namespace_project_commit_path
(
project
.
namespace
,
project
,
ci_commit
.
sha
)
builds
_namespace_project_commit_path
(
project
.
namespace
,
project
,
ci_commit
.
sha
)
end
def
ci_status_icon
(
ci_commit
)
...
...
app/views/projects/commit/_ci_menu.html.haml
Просмотр файла @
9a82702a
...
...
@@ -3,7 +3,7 @@
=
link_to
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
id
)
do
Changes
%span
.badge
=
@diffs
.
count
=
nav_link
(
path:
'commit#
ci
'
)
do
=
link_to
ci
_namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
id
)
do
=
nav_link
(
path:
'commit#
builds
'
)
do
=
link_to
builds
_namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
id
)
do
Builds
%span
.badge
=
@builds
.
count
app/views/projects/commit/ci.html.haml
Просмотр файла @
9a82702a
...
...
@@ -27,10 +27,10 @@
-
if
@ci_project
&&
current_user
&&
can?
(
current_user
,
:manage_builds
,
@project
)
-
if
@ci_commit
.
builds
.
latest
.
failed
.
any?
(
&
:retryable?
)
=
link_to
"Retry failed"
,
retry_
ci
_namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
sha
),
class:
'btn btn-xs btn-primary'
,
method: :post
=
link_to
"Retry failed"
,
retry_
builds
_namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
sha
),
class:
'btn btn-xs btn-primary'
,
method: :post
-
if
@ci_commit
.
builds
.
running_or_pending
.
any?
=
link_to
"Cancel running"
,
cancel_
ci
_namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
sha
),
class:
'btn btn-xs btn-danger'
,
method: :post
=
link_to
"Cancel running"
,
cancel_
builds
_namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
sha
),
class:
'btn btn-xs btn-danger'
,
method: :post
%table
.table.builds
%thead
...
...
config/routes.rb
Просмотр файла @
9a82702a
...
...
@@ -473,7 +473,7 @@
resources
:commit
,
only:
[
:show
],
constraints:
{
id:
/[[:alnum:]]{6,40}/
}
do
member
do
get
:branches
get
:
ci
get
:
builds
post
:cancel_builds
post
:retry_builds
end
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать